Skip to content

Commit

Permalink
Use new error message
Browse files Browse the repository at this point in the history
  • Loading branch information
sjberman committed Dec 17, 2024
1 parent 791b0ce commit 93d0332
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/mode/static/state/graph/nginxproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func validateRewriteClientIP(npCfg *ngfAPI.NginxProxy) field.ErrorList {
if len(rewriteClientIP.TrustedAddresses) > 16 {
allErrs = append(
allErrs,
field.TooLongMaxLength(trustedAddressesPath, rewriteClientIP.TrustedAddresses, 16),
field.TooMany(trustedAddressesPath, len(rewriteClientIP.TrustedAddresses), 16),
)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/state/graph/nginxproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ func TestValidateRewriteClientIP(t *testing.T) {
},
},
expectErrCount: 1,
errorString: "spec.rewriteClientIP.trustedAddresses: Too long: may not be longer than 16",
errorString: "spec.rewriteClientIP.trustedAddresses: Too many: 21: must have at most 16 items",
},
{
name: "invalid when mode is not proxyProtocol or XForwardedFor",
Expand Down

0 comments on commit 93d0332

Please sign in to comment.