Call-site comments: the "" arg to TooLong is unused

This commit is contained in:
Tim Hockin
2024-11-05 09:11:03 -08:00
parent 8a7af90300
commit c8eeb486f4
15 changed files with 33 additions and 33 deletions

View File

@@ -54,7 +54,7 @@ func ValidateSignerName(fldPath *field.Path, signerName string) field.ErrorList
// validate that segments[0] is less than 253 characters altogether
maxDomainSegmentLength := validation.DNS1123SubdomainMaxLength
if len(segments[0]) > maxDomainSegmentLength {
el = append(el, field.TooLong(fldPath, "", maxDomainSegmentLength))
el = append(el, field.TooLong(fldPath, "" /*unused*/, maxDomainSegmentLength))
}
// validate that segments[0] consists of valid DNS1123 labels separated by '.'
domainLabels := strings.Split(segments[0], ".")
@@ -97,7 +97,7 @@ func ValidateSignerName(fldPath *field.Path, signerName string) field.ErrorList
maxPathSegmentLength := validation.DNS1123SubdomainMaxLength + validation.DNS1123LabelMaxLength + 1
maxSignerNameLength := maxDomainSegmentLength + maxPathSegmentLength + 1
if len(signerName) > maxSignerNameLength {
el = append(el, field.TooLong(fldPath, "", maxSignerNameLength))
el = append(el, field.TooLong(fldPath, "" /*unused*/, maxSignerNameLength))
}
return el

View File

@@ -1685,7 +1685,7 @@ func ValidateCSIDriverName(driverName string, fldPath *field.Path) field.ErrorLi
}
if len(driverName) > 63 {
allErrs = append(allErrs, field.TooLong(fldPath, "", 63))
allErrs = append(allErrs, field.TooLong(fldPath, "" /*unused*/, 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"), "", maxLocalhostProfileLength))
allErrs = append(allErrs, field.TooLong(fldPath.Child("localhostProfile"), "" /*unused*/, maxLocalhostProfileLength))
}
}
@@ -6546,7 +6546,7 @@ func ValidateSecret(secret *core.Secret) field.ErrorList {
totalSize += len(value)
}
if totalSize > core.MaxSecretSize {
allErrs = append(allErrs, field.TooLong(dataPath, "", core.MaxSecretSize))
allErrs = append(allErrs, field.TooLong(dataPath, "" /*unused*/, core.MaxSecretSize))
}
switch secret.Type {
@@ -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(""), "", core.MaxSecretSize))
allErrs = append(allErrs, field.TooLong(field.NewPath(""), "" /*unused*/, core.MaxSecretSize))
}
return allErrs