diff --git a/pkg/azuredisk/controllerserver.go b/pkg/azuredisk/controllerserver.go index 7dc962716a..f33cd931b8 100644 --- a/pkg/azuredisk/controllerserver.go +++ b/pkg/azuredisk/controllerserver.go @@ -70,11 +70,14 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) klog.Errorf("invalid create volume req: %v", req) return nil, err } - params := req.GetParameters() - diskParams, err := azureutils.ParseDiskParameters(params) + diskParams, err := azureutils.ParseDiskParameters(req.GetParameters()) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "Failed parsing disk parameters: %v", err) } + if _, err = azureutils.ParseDiskParameters(req.GetMutableParameters()); err != nil { + return nil, status.Errorf(codes.InvalidArgument, "Failed parsing disk mutable parameters: %v", err) + } + name := req.GetName() if len(name) == 0 { return nil, status.Error(codes.InvalidArgument, "CreateVolume Name must be provided") @@ -400,7 +403,7 @@ func (d *Driver) ControllerModifyVolume(ctx context.Context, req *csi.Controller diskName, err := azureutils.GetDiskName(diskURI) if err != nil { - return nil, status.Errorf(codes.Internal, "%v", err) + return nil, status.Errorf(codes.NotFound, "%v", err) } if _, err := d.checkDiskExists(ctx, diskURI); err != nil { diff --git a/pkg/azuredisk/controllerserver_test.go b/pkg/azuredisk/controllerserver_test.go index 4fa9e647ae..c0f1761f97 100644 --- a/pkg/azuredisk/controllerserver_test.go +++ b/pkg/azuredisk/controllerserver_test.go @@ -666,7 +666,7 @@ func TestControllerModifyVolume(t *testing.T) { VolumeId: "123", }, expectedResp: nil, - expectedErrCode: codes.Internal, + expectedErrCode: codes.NotFound, }, { desc: "fail with wrong disk name", @@ -674,7 +674,7 @@ func TestControllerModifyVolume(t *testing.T) { VolumeId: "/subscriptions/123", }, expectedResp: nil, - expectedErrCode: codes.Internal, + expectedErrCode: codes.NotFound, }, { desc: "fail with wrong sku name", diff --git a/pkg/azuredisk/controllerserver_v2.go b/pkg/azuredisk/controllerserver_v2.go index 78ee23cb39..7d8609d12e 100644 --- a/pkg/azuredisk/controllerserver_v2.go +++ b/pkg/azuredisk/controllerserver_v2.go @@ -312,7 +312,7 @@ func (d *DriverV2) ControllerModifyVolume(ctx context.Context, req *csi.Controll diskName, err := azureutils.GetDiskName(diskURI) if err != nil { - return nil, status.Errorf(codes.Internal, "%v", err) + return nil, status.Errorf(codes.NotFound, "%v", err) } if _, err := d.checkDiskExists(ctx, diskURI); err != nil { diff --git a/test/sanity/run-tests-all-clouds.sh b/test/sanity/run-tests-all-clouds.sh index 800775c709..71daa5efec 100755 --- a/test/sanity/run-tests-all-clouds.sh +++ b/test/sanity/run-tests-all-clouds.sh @@ -21,7 +21,7 @@ function install_csi_sanity_bin { mkdir -p $GOPATH/src/github.com/kubernetes-csi pushd $GOPATH/src/github.com/kubernetes-csi export GO111MODULE=off - git clone https://github.com/kubernetes-csi/csi-test.git -b v5.2.0 + git clone https://github.com/kubernetes-csi/csi-test.git -b v5.3.1 pushd csi-test/cmd/csi-sanity make install popd