Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(policies): use GatewayAPI style header modifier in all policies #5757

Merged
merged 5 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api/common/v1alpha1/header.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package v1alpha1

// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=256
// +kubebuilder:validation:Pattern=`^[a-z0-9!#$%&'*+\-.^_\x60|~]+$`
type HeaderName string

type HeaderValue string
16 changes: 0 additions & 16 deletions api/common/v1alpha1/headermatch.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -885,24 +885,46 @@ spec:
requestHeadersToAdd:
description: The list of HTTP headers which should be
added to each health check request
items:
properties:
append:
default: true
description: If true (default) the header values
should be appended to already present ones
type: boolean
key:
description: Header name
type: string
value:
description: Header value
type: string
required:
- key
- value
type: object
type: array
properties:
add:
items:
properties:
name:
maxLength: 256
minLength: 1
pattern: ^[a-z0-9!#$%&'*+\-.^_\x60|~]+$
type: string
value:
type: string
required:
- name
- value
type: object
maxItems: 16
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
set:
items:
properties:
name:
maxLength: 256
minLength: 1
pattern: ^[a-z0-9!#$%&'*+\-.^_\x60|~]+$
type: string
value:
type: string
required:
- name
- value
type: object
maxItems: 16
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
type: object
type: object
initialJitter:
description: If specified, Envoy will start health checking
Expand Down Expand Up @@ -1146,7 +1168,7 @@ spec:
name:
maxLength: 256
minLength: 1
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
pattern: ^[a-z0-9!#$%&'*+\-.^_\x60|~]+$
type: string
value:
type: string
Expand All @@ -1170,7 +1192,7 @@ spec:
name:
maxLength: 256
minLength: 1
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
pattern: ^[a-z0-9!#$%&'*+\-.^_\x60|~]+$
type: string
value:
type: string
Expand Down Expand Up @@ -1240,7 +1262,7 @@ spec:
name:
maxLength: 256
minLength: 1
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
pattern: ^[a-z0-9!#$%&'*+\-.^_\x60|~]+$
type: string
value:
type: string
Expand All @@ -1264,7 +1286,7 @@ spec:
name:
maxLength: 256
minLength: 1
pattern: ^[A-Za-z0-9!#$%&'*+\-.^_\x60|~]+$
pattern: ^[a-z0-9!#$%&'*+\-.^_\x60|~]+$
type: string
value:
type: string
Expand Down Expand Up @@ -1872,23 +1894,46 @@ spec:
headers:
description: The Headers to be added to the
HTTP response on a rate limit event
items:
properties:
append:
default: true
description: Should the header be appended
type: boolean
key:
description: Header name
type: string
value:
description: Header value
type: string
required:
- key
- value
type: object
type: array
properties:
add:
items:
properties:
name:
maxLength: 256
minLength: 1
pattern: ^[a-z0-9!#$%&'*+\-.^_\x60|~]+$
type: string
value:
type: string
required:
- name
- value
type: object
maxItems: 16
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
set:
items:
properties:
name:
maxLength: 256
minLength: 1
pattern: ^[a-z0-9!#$%&'*+\-.^_\x60|~]+$
type: string
value:
type: string
required:
- name
- value
type: object
maxItems: 16
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
type: object
status:
description: The HTTP status code to be set
on a rate limit event
Expand Down Expand Up @@ -2147,6 +2192,9 @@ spec:
type: string
name:
description: The Name of the reset header.
maxLength: 256
minLength: 1
pattern: ^[a-z0-9!#$%&'*+\-.^_\x60|~]+$
type: string
type: object
type: array
Expand Down Expand Up @@ -2219,6 +2267,9 @@ spec:
type: string
name:
description: The Name of the reset header.
maxLength: 256
minLength: 1
pattern: ^[a-z0-9!#$%&'*+\-.^_\x60|~]+$
type: string
type: object
type: array
Expand All @@ -2228,17 +2279,36 @@ spec:
which must be present in the request for retries to
be attempted.
items:
description: HTTPHeaderMatch describes how to select
a HTTP route by matching HTTP request headers.
properties:
name:
description: Name is the name of the HTTP Header
to be matched. Name MUST be lower case as they
will be handled with case insensitivity (See
https://tools.ietf.org/html/rfc7230#section-3.2).
maxLength: 256
minLength: 1
pattern: ^[a-z0-9!#$%&'*+\-.^_\x60|~]+$
type: string
type:
default: Exact
description: Type specifies how to match against
the value of the header.
enum:
- REGULAR_EXPRESSION
- EXACT
- PREFIX
- Exact
- Present
- RegularExpression
- Absent
- Prefix
type: string
value:
description: Value is the value of HTTP Header
to be matched.
type: string
required:
- name
- value
type: object
type: array
retriableResponseHeaders:
Expand All @@ -2247,17 +2317,36 @@ spec:
A retry will be triggered if any of the header matches
match the upstream response headers.
items:
description: HTTPHeaderMatch describes how to select
a HTTP route by matching HTTP request headers.
properties:
name:
description: Name is the name of the HTTP Header
to be matched. Name MUST be lower case as they
will be handled with case insensitivity (See
https://tools.ietf.org/html/rfc7230#section-3.2).
maxLength: 256
minLength: 1
pattern: ^[a-z0-9!#$%&'*+\-.^_\x60|~]+$
type: string
type:
default: Exact
description: Type specifies how to match against
the value of the header.
enum:
- REGULAR_EXPRESSION
- EXACT
- PREFIX
- Exact
- Present
- RegularExpression
- Absent
- Prefix
type: string
value:
description: Value is the value of HTTP Header
to be matched.
type: string
required:
- name
- value
type: object
type: array
retryOn:
Expand Down
Loading