Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Shruthi-1MN
Copy link
Contributor

What this PR does / why we need it:
Implementation of controller and dock for file share feature - only implemented create, delete file share operation. Still driver code implementation is in progress. Integration test has to be done yet with sample driver code.

File share post code workflow is as below:
Controller workflow:
1 gRPC interface(model/fileshareproto, filesharecontroller.go)
2 Fileshare controller client(filesharecontroller/client)
3 selector to select the profiles
4 Filesharecontroller server(filesharecontroller/controller.go)
Dock workflow
1 It checks with fileshareproto to validate the dock creation
2 Client communicates to dock server(filesharedock/client)
3 Server dock.go - which registers to the dock and provision the dock so it contacts dock/discovery to discover and maps to backend drivers

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

Release note:

@Shruthi-1MN
Copy link
Contributor Author

@coveralls
Copy link

coveralls commented May 9, 2019

Coverage Status

Coverage decreased (-1.0%) to 29.275% when pulling 141d347 on Shruthi-1MN:fileshare-patch into 7e706f1 on opensds:development.

Copy link
Collaborator

@wisererik wisererik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -1,4 +1,4 @@
// Copyright (c) 2018 Huawei Technologies Co., Ltd. All Rights Reserved.
// Copyright 2019 The OpenSDS Authors
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a . here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Shruthi-1MN Shruthi-1MN force-pushed the fileshare-patch branch 2 times, most recently from abb9dee to ddad98e Compare May 9, 2019 15:00
@leonwanghui leonwanghui added the feature there is a huge framework change or feature addition label May 9, 2019
"github.com/opensds/opensds/pkg/dock/client"
"github.com/opensds/opensds/pkg/model"
pb "github.com/opensds/opensds/pkg/model/proto"
"golang.org/x/net/context"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use context package

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


"github.com/opensds/opensds/pkg/dock/client"
"github.com/opensds/opensds/pkg/model"
"github.com/opensds/opensds/pkg/model/proto"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this package since it's duplicate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,104 @@
// Copyright 2019 The OpenSDS Authors
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add . here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

prf, err = db.C.GetProfile(c.NewAdminContext(), in.ProfileId)
}
if err != nil {
log.Error("Get profile failed: ", err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to lower case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}
pools, err := db.C.ListPools(c.NewAdminContext())
if err != nil {
log.Error("When list pools in resources SelectSupportedPool: ", err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in entire function

package filesharedrivers

import (
"github.com/opensds/opensds/contrib/drivers/filesharedrivers/nfsnative"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename "nfsnative" to "nfs".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

func Init(resourceType string) FileShareDriver {
var f FileShareDriver
switch resourceType {
case config.NFSNativeDriverType:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/NFSNativeDriverType/NFSDriverType:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,50 @@
// Copyright 2019 The OpenSDS Authors.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to contrib/drivers/filesharedrivers/nfs/nfs.go

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// See the License for the specific language governing permissions and
// limitations under the License.

package nfsnative
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to "nfs"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


DRBDDriverType = "drbd"
const (
NFSNativeDriverType = "nfsnative"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NFSDriverType = "nfs"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return
}

// NOTE:It will create a file share entry into the database and initialize its status
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a space after "NOTE:"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


f.SuccessHandle(StatusAccepted, body)

// NOTE:The real file share creation process.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after "NOTE:"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


f.SuccessHandle(StatusAccepted, nil)

// NOTE:The real file share deletion process.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after "NOTE:"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

// NOTE:It will update the the status of the volume snapshot waiting for deletion in
// NOTE:It will update the the status of the file share snapshot waiting for deletion in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after NOTE:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@xing-yang
Copy link
Collaborator

Also need a rebase.

// The locality that file share belongs to, required.
string availabilityZone = 6;
// The service level that file share belongs to, required.
string profileId = 7;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed.

Copy link
Contributor Author

@Shruthi-1MN Shruthi-1MN May 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i will remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

string id = 1;
// The service level that fileshare belongs to, required.
// This item will be replace by profile
string profileId = 2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove it. We already have profile below.

Copy link
Contributor Author

@Shruthi-1MN Shruthi-1MN May 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok i will remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Shruthi-1MN Shruthi-1MN force-pushed the fileshare-patch branch 3 times, most recently from 7b25b29 to 047e9ba Compare May 10, 2019 07:28
Copy link
Collaborator

@leonwanghui leonwanghui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wisererik wisererik merged commit e772087 into sodafoundation:development May 10, 2019
@Shruthi-1MN Shruthi-1MN deleted the fileshare-patch branch May 20, 2019 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature there is a huge framework change or feature addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants