Skip to content

Commit

Permalink
fail creating file volume using VCP storageclass
Browse files Browse the repository at this point in the history
  • Loading branch information
divyenpatel committed Sep 21, 2020
1 parent 05f9c7d commit d7f911f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/csi/service/vanilla/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ func (c *controller) createFileVolume(ctx context.Context, req *csi.CreateVolume
volSizeBytes = int64(req.GetCapacityRange().GetRequiredBytes())
}
volSizeMB := int64(common.RoundUpSize(volSizeBytes, common.MbInBytes))

scParams, err := common.ParseStorageClassParams(ctx, req.Parameters)
if err != nil {
msg := fmt.Sprintf("Parsing storage class parameters failed with error: %+v", err)
Expand Down Expand Up @@ -494,6 +493,11 @@ func (c *controller) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequ
log.Infof("CreateVolume: called with args %+v", *req)

if common.IsFileVolumeRequest(ctx, req.GetVolumeCapabilities()) {
if req.Parameters[common.CSIMigrationParams] == "true" {
msg := "can't create file volume using VCP StorageClass"
log.Error(msg)
return nil, status.Error(codes.InvalidArgument, msg)
}
vsan67u3Release, err := isVsan67u3Release(ctx, c)
if err != nil {
log.Error("failed to get vcenter version to help identify if fileshare volume creation should be permitted or not. Error:%v", err)
Expand Down

0 comments on commit d7f911f

Please sign in to comment.