Validate CSI Inline Migration unconditionally

This commit is contained in:
Ted Yu
2019-08-06 08:33:25 -07:00
committed by Ted Yu
parent c981c65c90
commit bb77aa7a63
2 changed files with 4 additions and 18 deletions

View File

@@ -187,11 +187,7 @@ func validateVolumeAttachmentSource(source *storage.VolumeAttachmentSource, fldP
allErrs = append(allErrs, field.Required(fldPath.Child("persistentVolumeName"), "must specify non empty persistentVolumeName"))
}
case source.InlineVolumeSpec != nil:
if utilfeature.DefaultFeatureGate.Enabled(features.CSIMigration) {
allErrs = append(allErrs, storagevalidation.ValidatePersistentVolumeSpec(source.InlineVolumeSpec, "", true, fldPath.Child("inlineVolumeSpec"))...)
} else {
allErrs = append(allErrs, field.Forbidden(fldPath, "may not specify inlineVolumeSpec when CSIMigration feature is disabled"))
}
allErrs = append(allErrs, storagevalidation.ValidatePersistentVolumeSpec(source.InlineVolumeSpec, "", true, fldPath.Child("inlineVolumeSpec"))...)
}
return allErrs
}