Merge pull request #72666 from rajathagasthya/pvc-72651

Move VolumeSnapshotDataSource feature gate check from validation
This commit is contained in:
Kubernetes Prow Robot
2019-01-08 19:22:30 -08:00
committed by GitHub
4 changed files with 107 additions and 12 deletions

View File

@@ -1834,9 +1834,7 @@ func ValidatePersistentVolumeClaimSpec(spec *core.PersistentVolumeClaimSpec, fld
allErrs = append(allErrs, field.NotSupported(fldPath.Child("volumeMode"), *spec.VolumeMode, supportedVolumeModes.List()))
}
if spec.DataSource != nil && !utilfeature.DefaultFeatureGate.Enabled(features.VolumeSnapshotDataSource) {
allErrs = append(allErrs, field.Forbidden(fldPath.Child("dataSource"), "VolumeSnapshotDataSource is disabled by feature-gate"))
} else if spec.DataSource != nil {
if spec.DataSource != nil {
if len(spec.DataSource.Name) == 0 {
allErrs = append(allErrs, field.Required(fldPath.Child("dataSource", "name"), ""))
}