mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	remove subpath feature validation failure
This commit is contained in:
		@@ -2299,12 +2299,8 @@ 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"))...)
 | 
			
		||||
		}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if mnt.MountPropagation != nil {
 | 
			
		||||
			allErrs = append(allErrs, validateMountPropagation(mnt.MountPropagation, container, fldPath.Child("mountPropagation"))...)
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user