@@ -298,6 +298,7 @@ type HTTPPathMatch struct {
298
298
//
299
299
// +optional
300
300
// +kubebuilder:default="/"
301
+ // +kubebuilder:validation:MaxLength=1024
301
302
Value * string `json:"value,omitempty"`
302
303
}
303
304
@@ -318,6 +319,13 @@ const (
318
319
HeaderMatchImplementationSpecific HeaderMatchType = "ImplementationSpecific"
319
320
)
320
321
322
+ // HTTPHeaderName is the name of an HTTP header.
323
+ //
324
+ // +kubebuilder:validation:MinLength=1
325
+ // +kubebuilder:validation:MaxLength=256
326
+ // +kubebuilder:validation:Pattern=`^[-A-Za-z0-9]+$`
327
+ type HTTPHeaderName string
328
+
321
329
// HTTPHeaderMatch describes how to select a HTTP route by matching HTTP request
322
330
// headers.
323
331
type HTTPHeaderMatch struct {
@@ -344,10 +352,7 @@ type HTTPHeaderMatch struct {
344
352
// entries with an equivalent header name MUST be ignored. Due to the
345
353
// case-insensitivity of header names, "foo" and "Foo" are considered
346
354
// equivalent.
347
- //
348
- // +kubebuilder:validation:MinLength=1
349
- // +kubebuilder:validation:MaxLength=256
350
- Name string `json:"name"`
355
+ Name HTTPHeaderName `json:"name"`
351
356
352
357
// Value is the value of HTTP Header to be matched.
353
358
//
@@ -453,13 +458,17 @@ type HTTPRouteMatch struct {
453
458
// ANDed together, meaning, a request must match all the specified headers
454
459
// to select the route.
455
460
//
461
+ // +listType=map
462
+ // +listMapKey=name
456
463
// +optional
457
464
Headers []HTTPHeaderMatch `json:"headers,omitempty"`
458
465
459
466
// QueryParams specifies HTTP query parameter matchers. Multiple match
460
467
// values are ANDed together, meaning, a request must match all the
461
468
// specified query parameters to select the route.
462
469
//
470
+ // +listType=map
471
+ // +listMapKey=name
463
472
// +optional
464
473
QueryParams []HTTPQueryParamMatch `json:"queryParams,omitempty"`
465
474
@@ -604,10 +613,7 @@ type HTTPHeader struct {
604
613
// entries with an equivalent header name MUST be ignored. Due to the
605
614
// case-insensitivity of header names, "foo" and "Foo" are considered
606
615
// equivalent.
607
- //
608
- // +kubebuilder:validation:MinLength=1
609
- // +kubebuilder:validation:MaxLength=256
610
- Name string `json:"name"`
616
+ Name HTTPHeaderName `json:"name"`
611
617
612
618
// Value is the value of HTTP Header to be matched.
613
619
//
@@ -688,30 +694,34 @@ type HTTPRequestRedirect struct {
688
694
//
689
695
// +optional
690
696
// +kubebuilder:validation:Enum=HTTP;HTTPS
697
+
691
698
Protocol * string `json:"protocol,omitempty"`
699
+
692
700
// Hostname is the hostname to be used in the value of the `Location`
693
701
// header in the response.
694
702
// When empty, the hostname of the request is used.
695
703
//
696
704
// Support: Core
697
705
//
698
706
// +optional
699
- Hostname * string `json:"hostname,omitempty"`
707
+ Hostname * Hostname `json:"hostname,omitempty"`
708
+
700
709
// Port is the port to be used in the value of the `Location`
701
710
// header in the response.
702
711
// When empty, port (if specified) of the request is used.
703
712
//
704
713
// Support: Extended
705
714
//
706
715
// +optional
707
- Port * int `json:"port,omitempty"`
716
+ Port * PortNumber `json:"port,omitempty"`
717
+
708
718
// StatusCode is the HTTP status code to be used in response.
709
719
//
710
720
// Support: Core
711
721
//
712
722
// +optional
713
723
// +kubebuilder:default=302
714
- // +kubebuilder:validation=301;302
724
+ // +kubebuilder:validation:Enum =301;302
715
725
StatusCode * int `json:"statusCode,omitempty"`
716
726
}
717
727
0 commit comments