mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2026-01-08 16:21:50 +00:00
Clarify that value arg to field.TooLong is unused
This commit is contained in:
@@ -1685,7 +1685,7 @@ func ValidateCSIDriverName(driverName string, fldPath *field.Path) field.ErrorLi
|
||||
}
|
||||
|
||||
if len(driverName) > 63 {
|
||||
allErrs = append(allErrs, field.TooLong(fldPath, driverName, 63))
|
||||
allErrs = append(allErrs, field.TooLong(fldPath, "", 63))
|
||||
}
|
||||
|
||||
for _, msg := range validation.IsDNS1123Subdomain(strings.ToLower(driverName)) {
|
||||
@@ -4758,7 +4758,7 @@ func ValidateAppArmorProfileField(profile *core.AppArmorProfile, fldPath *field.
|
||||
|
||||
const maxLocalhostProfileLength = 4095 // PATH_MAX - 1
|
||||
if len(*profile.LocalhostProfile) > maxLocalhostProfileLength {
|
||||
allErrs = append(allErrs, field.TooLong(fldPath.Child("localhostProfile"), *profile.LocalhostProfile, maxLocalhostProfileLength))
|
||||
allErrs = append(allErrs, field.TooLong(fldPath.Child("localhostProfile"), "", maxLocalhostProfileLength))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6661,7 +6661,7 @@ func ValidateConfigMap(cfg *core.ConfigMap) field.ErrorList {
|
||||
}
|
||||
if totalSize > core.MaxSecretSize {
|
||||
// pass back "" to indicate that the error refers to the whole object.
|
||||
allErrs = append(allErrs, field.TooLong(field.NewPath(""), cfg, core.MaxSecretSize))
|
||||
allErrs = append(allErrs, field.TooLong(field.NewPath(""), "", core.MaxSecretSize))
|
||||
}
|
||||
|
||||
return allErrs
|
||||
|
||||
Reference in New Issue
Block a user