Tolerate existing CSI fields in PVs when the feature is disabled

This commit is contained in:
Jordan Liggitt
2018-11-14 15:24:19 -05:00
committed by Hemant Kumar
parent 8cfce0af99
commit eaff4fd4d2
8 changed files with 186 additions and 85 deletions

View File

@@ -1463,10 +1463,6 @@ func ValidateCSIDriverName(driverName string, fldPath *field.Path) field.ErrorLi
func validateCSIPersistentVolumeSource(csi *core.CSIPersistentVolumeSource, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{}
if !utilfeature.DefaultFeatureGate.Enabled(features.CSIPersistentVolume) {
allErrs = append(allErrs, field.Forbidden(fldPath, "CSIPersistentVolume disabled by feature-gate"))
}
allErrs = append(allErrs, ValidateCSIDriverName(csi.Driver, fldPath.Child("driver"))...)
if len(csi.VolumeHandle) == 0 {