diff --git a/pkg/cephfs/controllerserver.go b/pkg/cephfs/controllerserver.go index 1afd761f5..ade6aeef4 100644 --- a/pkg/cephfs/controllerserver.go +++ b/pkg/cephfs/controllerserver.go @@ -22,7 +22,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/container-storage-interface/spec/lib/go/csi/v0" + "github.com/container-storage-interface/spec/lib/go/csi" "github.com/kubernetes-csi/drivers/pkg/csi-common" ) @@ -41,7 +41,6 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol } // Configuration - volOptions, err := newVolumeOptions(req.GetParameters()) if err != nil { glog.Errorf("validation of volume options failed: %v", err) @@ -61,7 +60,7 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol if volOptions.ProvisionVolume { // Admin credentials are required - cr, err := getAdminCredentials(req.GetControllerCreateSecrets()) + cr, err := getAdminCredentials(req.GetSecrets()) if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } @@ -98,9 +97,9 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol return &csi.CreateVolumeResponse{ Volume: &csi.Volume{ - Id: string(volId), + VolumeId: string(volId), CapacityBytes: sz, - Attributes: req.GetParameters(), + VolumeContext: req.GetParameters(), }, }, nil } @@ -142,7 +141,7 @@ func (cs *controllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol // Deleting a volume requires admin credentials - cr, err := getAdminCredentials(req.GetControllerDeleteSecrets()) + cr, err := getAdminCredentials(req.GetSecrets()) if err != nil { glog.Errorf("failed to retrieve admin credentials: %v", err) return nil, status.Error(codes.InvalidArgument, err.Error()) @@ -169,8 +168,12 @@ func (cs *controllerServer) ValidateVolumeCapabilities( // Cephfs doesn't support Block volume for _, cap := range req.VolumeCapabilities { if cap.GetBlock() != nil { - return &csi.ValidateVolumeCapabilitiesResponse{Supported: false, Message: ""}, nil + return &csi.ValidateVolumeCapabilitiesResponse{Message: ""}, nil } } - return &csi.ValidateVolumeCapabilitiesResponse{Supported: true}, nil + return &csi.ValidateVolumeCapabilitiesResponse{ + Confirmed: &csi.ValidateVolumeCapabilitiesResponse_Confirmed{ + VolumeCapabilities: req.VolumeCapabilities, + }, + }, nil } diff --git a/pkg/cephfs/driver.go b/pkg/cephfs/driver.go index b73f602b0..1297974c2 100644 --- a/pkg/cephfs/driver.go +++ b/pkg/cephfs/driver.go @@ -21,7 +21,7 @@ import ( "github.com/golang/glog" - "github.com/container-storage-interface/spec/lib/go/csi/v0" + "github.com/container-storage-interface/spec/lib/go/csi" "github.com/kubernetes-csi/drivers/pkg/csi-common" ) diff --git a/pkg/cephfs/identityserver.go b/pkg/cephfs/identityserver.go index 8c1f7371e..c506c9299 100644 --- a/pkg/cephfs/identityserver.go +++ b/pkg/cephfs/identityserver.go @@ -19,7 +19,7 @@ package cephfs import ( "context" - "github.com/container-storage-interface/spec/lib/go/csi/v0" + "github.com/container-storage-interface/spec/lib/go/csi" "github.com/kubernetes-csi/drivers/pkg/csi-common" ) diff --git a/pkg/cephfs/nodeserver.go b/pkg/cephfs/nodeserver.go index fd786b7a7..8dfcf0a86 100644 --- a/pkg/cephfs/nodeserver.go +++ b/pkg/cephfs/nodeserver.go @@ -25,7 +25,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/container-storage-interface/spec/lib/go/csi/v0" + "github.com/container-storage-interface/spec/lib/go/csi" "github.com/kubernetes-csi/drivers/pkg/csi-common" ) @@ -44,7 +44,7 @@ func getCredentialsForVolume(volOptions *volumeOptions, volId volumeID, req *csi // First, store admin credentials - those are needed for retrieving the user credentials - adminCr, err := getAdminCredentials(req.GetNodeStageSecrets()) + adminCr, err := getAdminCredentials(req.GetSecrets()) if err != nil { return nil, fmt.Errorf("failed to get admin credentials from node stage secrets: %v", err) } @@ -64,7 +64,7 @@ func getCredentialsForVolume(volOptions *volumeOptions, volId volumeID, req *csi } else { // The volume is pre-made, credentials are in node stage secrets - userCr, err = getUserCredentials(req.GetNodeStageSecrets()) + userCr, err = getUserCredentials(req.GetSecrets()) if err != nil { return nil, fmt.Errorf("failed to get user credentials from node stage secrets: %v", err) } @@ -87,7 +87,7 @@ func (ns *nodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVol stagingTargetPath := req.GetStagingTargetPath() volId := volumeID(req.GetVolumeId()) - volOptions, err := newVolumeOptions(req.GetVolumeAttributes()) + volOptions, err := newVolumeOptions(req.GetVolumeContext()) if err != nil { glog.Errorf("error reading volume options for volume %s: %v", volId, err) return nil, status.Error(codes.InvalidArgument, err.Error()) diff --git a/pkg/cephfs/util.go b/pkg/cephfs/util.go index ff2655254..9dce7063c 100644 --- a/pkg/cephfs/util.go +++ b/pkg/cephfs/util.go @@ -26,7 +26,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/container-storage-interface/spec/lib/go/csi/v0" + "github.com/container-storage-interface/spec/lib/go/csi" "github.com/pborman/uuid" "k8s.io/kubernetes/pkg/util/mount" ) @@ -144,7 +144,7 @@ func validateNodeStageVolumeRequest(req *csi.NodeStageVolumeRequest) error { return fmt.Errorf("staging target path missing in request") } - if req.GetNodeStageSecrets() == nil || len(req.GetNodeStageSecrets()) == 0 { + if req.GetSecrets() == nil || len(req.GetSecrets()) == 0 { return fmt.Errorf("stage secrets cannot be nil or empty") }