diff --git a/pkg/apis/core/validation/validation.go b/pkg/apis/core/validation/validation.go index 4643720eddd..c81aa339bff 100644 --- a/pkg/apis/core/validation/validation.go +++ b/pkg/apis/core/validation/validation.go @@ -2299,11 +2299,7 @@ func ValidateVolumeMounts(mounts []core.VolumeMount, voldevices map[string]strin } if len(mnt.SubPath) > 0 { - if !utilfeature.DefaultFeatureGate.Enabled(features.VolumeSubpath) { - allErrs = append(allErrs, field.Forbidden(fldPath.Child("subPath"), "subPath is disabled by feature-gate")) - } else { - allErrs = append(allErrs, validateLocalDescendingPath(mnt.SubPath, fldPath.Child("subPath"))...) - } + allErrs = append(allErrs, validateLocalDescendingPath(mnt.SubPath, fldPath.Child("subPath"))...) } if mnt.MountPropagation != nil { diff --git a/pkg/apis/core/validation/validation_test.go b/pkg/apis/core/validation/validation_test.go index 1c53800f704..9cfe7369e70 100644 --- a/pkg/apis/core/validation/validation_test.go +++ b/pkg/apis/core/validation/validation_test.go @@ -4931,7 +4931,7 @@ func TestValidateDisabledSubpath(t *testing.T) { SubPath: "baz", }, }, - true, + false, // validation should not fail, dropping the field is handled in PrepareForCreate/PrepareForUpdate }, }