mirror of https://github.com/k3s-io/k3s
remove subpath feature validation failure
parent
de96583d8c
commit
c4a0254201
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue