Skip to content

Commit 93d0332

Browse files
committed
Use new error message
1 parent 791b0ce commit 93d0332

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/mode/static/state/graph/nginxproxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func validateRewriteClientIP(npCfg *ngfAPI.NginxProxy) field.ErrorList {
208208
if len(rewriteClientIP.TrustedAddresses) > 16 {
209209
allErrs = append(
210210
allErrs,
211-
field.TooLongMaxLength(trustedAddressesPath, rewriteClientIP.TrustedAddresses, 16),
211+
field.TooMany(trustedAddressesPath, len(rewriteClientIP.TrustedAddresses), 16),
212212
)
213213
}
214214

internal/mode/static/state/graph/nginxproxy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ func TestValidateRewriteClientIP(t *testing.T) {
551551
},
552552
},
553553
expectErrCount: 1,
554-
errorString: "spec.rewriteClientIP.trustedAddresses: Too long: may not be longer than 16",
554+
errorString: "spec.rewriteClientIP.trustedAddresses: Too many: 21: must have at most 16 items",
555555
},
556556
{
557557
name: "invalid when mode is not proxyProtocol or XForwardedFor",

0 commit comments

Comments
 (0)