fix userid validation
This commit is contained in:
		@@ -4813,8 +4813,8 @@ func ValidateSecurityContext(sc *core.SecurityContext, fldPath *field.Path) fiel
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if sc.RunAsUser != nil {
 | 
			
		||||
		if *sc.RunAsUser < 0 {
 | 
			
		||||
			allErrs = append(allErrs, field.Invalid(fldPath.Child("runAsUser"), *sc.RunAsUser, isNegativeErrorMsg))
 | 
			
		||||
		for _, msg := range validation.IsValidUserID(*sc.RunAsUser) {
 | 
			
		||||
			allErrs = append(allErrs, field.Invalid(fldPath.Child("runAsUser"), *sc.RunAsUser, msg))
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -11752,7 +11752,7 @@ func TestValidateSecurityContext(t *testing.T) {
 | 
			
		||||
		"negative RunAsUser": {
 | 
			
		||||
			sc:          negativeRunAsUser,
 | 
			
		||||
			errorType:   "FieldValueInvalid",
 | 
			
		||||
			errorDetail: isNegativeErrorMsg,
 | 
			
		||||
			errorDetail: "must be between",
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
	for k, v := range errorCases {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user