File tree 4 files changed +5
-6
lines changed
internal/mode/static/state/graph
4 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -155,10 +155,9 @@ type RewriteClientIP struct {
155
155
// Sets NGINX directive set_real_ip_from: https://nginx.org/en/docs/http/ngx_http_realip_module.html#set_real_ip_from
156
156
// This field is required if mode is set.
157
157
// +kubebuilder:validation:MaxItems=16
158
- // +listType=map
158
+ // +listType=map
159
159
// +listMapKey=type
160
160
//
161
- //
162
161
// +optional
163
162
TrustedAddresses []Address `json:"trustedAddresses,omitempty"`
164
163
}
@@ -201,6 +200,6 @@ type AddressType string
201
200
202
201
const (
203
202
// AddressTypeCIDR specifies that the address is a CIDR block.
204
- // kubebuilder:validation:Pattern=`^[\.a-zA-Z0-9:: ]*(\/([0-9]?[0-9]?[0-8 ]))$`
203
+ // kubebuilder:validation:Pattern=`^[\.a-zA-Z0-9:]*(\/([0-9]?[0-9]?[0-9 ]))$`
205
204
AddressTypeCIDR AddressType = "cidr"
206
205
)
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ func validateRewriteClientIP(npCfg *ngfAPI.NginxProxy) field.ErrorList {
186
186
default :
187
187
allErrs = append (
188
188
allErrs ,
189
- field .NotSupported (trustedAddressesPath .Child (addr . Value ),
189
+ field .NotSupported (trustedAddressesPath .Child ("type" ),
190
190
addr .Type ,
191
191
[]string {string (ngfAPI .AddressTypeCIDR )},
192
192
),
Original file line number Diff line number Diff line change @@ -535,7 +535,7 @@ func TestValidateRewriteClientIP(t *testing.T) {
535
535
},
536
536
},
537
537
expectErrCount : 1 ,
538
- errorString : "spec.rewriteClientIP.trustedAddresses.2001:db8::/129 : " +
538
+ errorString : "spec.rewriteClientIP.trustedAddresses.type : " +
539
539
"Unsupported value: \" invalid\" : supported values: \" cidr\" " ,
540
540
},
541
541
}
Original file line number Diff line number Diff line change @@ -533,7 +533,7 @@ string
533
533
</thead >
534
534
<tbody ><tr ><td ><p >" ; cidr" ; </p ></td >
535
535
<td ><p >AddressTypeCIDR specifies that the address is a CIDR block.
536
- kubebuilder:validation: Pattern =<code >^[ \. a-zA-Z0-9:: ] * (\/ ([ 0-9] ?[ 0-9] ?[ 0-8 ] ))$</code ></p >
536
+ kubebuilder:validation: Pattern =<code >^[ \. a-zA-Z0-9:] * (\/ ([ 0-9] ?[ 0-9] ?[ 0-9 ] ))$</code ></p >
537
537
</td >
538
538
</tr ></tbody >
539
539
</table >
You can’t perform that action at this time.
0 commit comments