Skip to content

Commit

Permalink
updating
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Volchok <[email protected]>
  • Loading branch information
alexwo committed Oct 18, 2024
2 parents 695dacf + 5a1c065 commit 9ca0ccd
Show file tree
Hide file tree
Showing 68 changed files with 2,938 additions and 393 deletions.
1 change: 0 additions & 1 deletion api/v1alpha1/backend_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ type BackendSpec struct {
// the health of the active backends falls below 72%.
//
// +optional
// +notImplementedHide
Fallback *bool `json:"fallback,omitempty"`
}

Expand Down
20 changes: 20 additions & 0 deletions api/v1alpha1/httproutefilter_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ type HTTPRouteFilter struct {
type HTTPRouteFilterSpec struct {
// +optional
URLRewrite *HTTPURLRewriteFilter `json:"urlRewrite,omitempty"`
// +optional
DirectResponse *HTTPDirectResponseFilter `json:"directResponse,omitempty"`
}

// HTTPURLRewriteFilter define rewrites of HTTP URL components such as path and host
Expand All @@ -49,6 +51,24 @@ type HTTPURLRewriteFilter struct {
Path *HTTPPathModifier `json:"path,omitempty"`
}

// HTTPDirectResponseFilter defines the configuration to return a fixed response.
type HTTPDirectResponseFilter struct {
// Content Type of the response. This will be set in the Content-Type header.
//
// +optional
ContentType *string `json:"contentType,omitempty"`

// Body of the Response
//
// +optional
Body *CustomResponseBody `json:"body,omitempty"`

// Status Code of the HTTP response
// If unset, defaults to 200.
// +optional
StatusCode *int `json:"statusCode,omitempty"`
}

// HTTPPathModifierType defines the type of path redirect or rewrite.
type HTTPPathModifierType string

Expand Down
3 changes: 2 additions & 1 deletion api/v1alpha1/oidc_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ type OIDC struct {

// OIDCProvider defines the OIDC Provider configuration.
// +kubebuilder:validation:XValidation:rule="!has(self.backendRef)",message="BackendRefs must be used, backendRef is not supported."
// +kubebuilder:validation:XValidation:rule="has(self.backendRefs)? self.backendRefs.size() > 1 : true",message="Only one backendRefs is allowed."
// +kubebuilder:validation:XValidation:rule="has(self.backendSettings)? (has(self.backendSettings.retry)?(has(self.backendSettings.retry.perRetry)? !has(self.backendSettings.retry.perRetry.timeout):true):true):true",message="Retry timeout is not supported."
// +kubebuilder:validation:XValidation:rule="has(self.backendSettings)? (has(self.backendSettings.retry)?(has(self.backendSettings.retry.retryOn)? !has(self.backendSettings.retry.retryOn.httpStatusCodes):true):true):true",message="HTTPStatusCodes is not supported."
type OIDCProvider struct {
// BackendRefs is used to specify the address of the OIDC Provider.
// If the BackendRefs is not specified, The host and port of the OIDC Provider's token endpoint
Expand Down
9 changes: 0 additions & 9 deletions api/v1alpha1/ratelimit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ type RateLimitSelectCondition struct {
// meaning, a request MUST match all the specified headers.
// At least one of headers or sourceCIDR condition must be specified.
//
// +listType=map
// +listMapKey=name
// +optional
// +kubebuilder:validation:MaxItems=16
Headers []HeaderMatch `json:"headers,omitempty"`
Expand Down Expand Up @@ -138,13 +136,6 @@ type SourceMatch struct {
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=256
Value string `json:"value"`

// Invert specifies whether the value match result will be inverted.
//
// +optional
// +kubebuilder:default=false
// +notImplementedHide
Invert *bool `json:"invert,omitempty"`
}

// HeaderMatch defines the match attributes within the HTTP Headers of the request.
Expand Down
4 changes: 3 additions & 1 deletion api/v1alpha1/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,9 @@ type CustomResponse struct {
ContentType *string `json:"contentType,omitempty"`

// Body of the Custom Response
Body CustomResponseBody `json:"body"`
//
// +optional
Body *CustomResponseBody `json:"body,omitempty"`
}

// ResponseValueType defines the types of values for the response body supported by Envoy Gateway.
Expand Down
46 changes: 40 additions & 6 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -727,19 +727,11 @@ spec:
type: object
maxItems: 16
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
sourceCIDR:
description: |-
SourceCIDR is the client IP Address range to match on.
At least one of headers or sourceCIDR condition must be specified.
properties:
invert:
default: false
description: Invert specifies whether the
value match result will be inverted.
type: boolean
type:
default: Exact
enum:
Expand Down Expand Up @@ -870,19 +862,11 @@ spec:
type: object
maxItems: 16
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
sourceCIDR:
description: |-
SourceCIDR is the client IP Address range to match on.
At least one of headers or sourceCIDR condition must be specified.
properties:
invert:
default: false
description: Invert specifies whether the
value match result will be inverted.
type: boolean
type:
default: Exact
enum:
Expand Down Expand Up @@ -1051,8 +1035,6 @@ spec:
description: Content Type of the response. This will be
set in the Content-Type header.
type: string
required:
- body
type: object
required:
- match
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,66 @@ spec:
spec:
description: Spec defines the desired state of HTTPRouteFilter.
properties:
directResponse:
description: HTTPDirectResponseFilter defines the configuration to
return a fixed response.
properties:
body:
description: Body of the Response
properties:
inline:
description: Inline contains the value as an inline string.
type: string
type:
description: Type is the type of method to use to read the
body value.
enum:
- Inline
- ValueRef
type: string
valueRef:
description: |-
ValueRef contains the contents of the body
specified as a local object reference.
Only a reference to ConfigMap is supported.
properties:
group:
description: |-
Group is the group of the referent. For example, "gateway.networking.k8s.io".
When unspecified or empty string, core API group is inferred.
maxLength: 253
pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
kind:
description: Kind is kind of the referent. For example
"HTTPRoute" or "Service".
maxLength: 63
minLength: 1
pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$
type: string
name:
description: Name is the name of the referent.
maxLength: 253
minLength: 1
type: string
required:
- group
- kind
- name
type: object
required:
- type
type: object
contentType:
description: Content Type of the response. This will be set in
the Content-Type header.
type: string
statusCode:
description: |-
Status Code of the HTTP response
If unset, defaults to 200.
type: integer
type: object
urlRewrite:
description: HTTPURLRewriteFilter define rewrites of HTTP URL components
such as path and host
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3261,9 +3261,12 @@ spec:
x-kubernetes-validations:
- message: BackendRefs must be used, backendRef is not supported.
rule: '!has(self.backendRef)'
- message: Only one backendRefs is allowed.
rule: 'has(self.backendRefs)? self.backendRefs.size() > 1 :
true'
- message: Retry timeout is not supported.
rule: has(self.backendSettings)? (has(self.backendSettings.retry)?(has(self.backendSettings.retry.perRetry)?
!has(self.backendSettings.retry.perRetry.timeout):true):true):true
- message: HTTPStatusCodes is not supported.
rule: has(self.backendSettings)? (has(self.backendSettings.retry)?(has(self.backendSettings.retry.retryOn)?
!has(self.backendSettings.retry.retryOn.httpStatusCodes):true):true):true
redirectURL:
description: |-
The redirect URL to be used in the OIDC
Expand Down
4 changes: 4 additions & 0 deletions charts/gateway-helm/templates/infra-manager-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ rules:
resources:
- serviceaccounts
- services
- configmaps
verbs:
- create
- get
- delete
- deletecollection
- patch
- apiGroups:
- apps
Expand All @@ -25,6 +27,7 @@ rules:
- create
- get
- delete
- deletecollection
- patch
- apiGroups:
- autoscaling
Expand All @@ -36,6 +39,7 @@ rules:
- create
- get
- delete
- deletecollection
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
2 changes: 1 addition & 1 deletion examples/extension-server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.23.1

require (
github.com/envoyproxy/gateway v1.0.2
github.com/envoyproxy/go-control-plane v0.13.1-0.20240917224354-20d038a70568
github.com/envoyproxy/go-control-plane v0.13.1
github.com/urfave/cli/v2 v2.27.4
google.golang.org/grpc v1.67.1
google.golang.org/protobuf v1.35.1
Expand Down
4 changes: 2 additions & 2 deletions examples/extension-server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/envoyproxy/go-control-plane v0.13.1-0.20240917224354-20d038a70568 h1:bUMUmkPtm/z62/8WiVbxtqTK8I7AzXGYn+qB8JAzAXw=
github.com/envoyproxy/go-control-plane v0.13.1-0.20240917224354-20d038a70568/go.mod h1:X45hY0mufo6Fd0KW3rqsGvQMw58jvjymeCzBU3mWyHw=
github.com/envoyproxy/go-control-plane v0.13.1 h1:vPfJZCkob6yTMEgS+0TwfTUfbHjfy/6vOJ8hUWX/uXE=
github.com/envoyproxy/go-control-plane v0.13.1/go.mod h1:X45hY0mufo6Fd0KW3rqsGvQMw58jvjymeCzBU3mWyHw=
github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM=
github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4=
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/docker/cli v27.3.1+incompatible
github.com/dominikbraun/graph v0.23.0
github.com/envoyproxy/go-control-plane v0.13.1-0.20240917224354-20d038a70568
github.com/envoyproxy/go-control-plane v0.13.1
github.com/envoyproxy/ratelimit v1.4.1-0.20230427142404-e2a87f41d3a7
github.com/evanphx/json-patch/v5 v5.9.0
github.com/fatih/color v1.17.0
Expand Down Expand Up @@ -159,7 +159,7 @@ require (
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/mountinfo v0.7.2 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.2.0 // indirect
github.com/moby/sys/user v0.3.0 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRr
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.13.1-0.20240917224354-20d038a70568 h1:bUMUmkPtm/z62/8WiVbxtqTK8I7AzXGYn+qB8JAzAXw=
github.com/envoyproxy/go-control-plane v0.13.1-0.20240917224354-20d038a70568/go.mod h1:X45hY0mufo6Fd0KW3rqsGvQMw58jvjymeCzBU3mWyHw=
github.com/envoyproxy/go-control-plane v0.13.1 h1:vPfJZCkob6yTMEgS+0TwfTUfbHjfy/6vOJ8hUWX/uXE=
github.com/envoyproxy/go-control-plane v0.13.1/go.mod h1:X45hY0mufo6Fd0KW3rqsGvQMw58jvjymeCzBU3mWyHw=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM=
github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4=
Expand Down Expand Up @@ -601,8 +601,8 @@ github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9Kou
github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4=
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
github.com/moby/sys/user v0.2.0 h1:OnpapJsRp25vkhw8TFG6OLJODNh/3rEwRWtJ3kakwRM=
github.com/moby/sys/user v0.2.0/go.mod h1:RYstrcWOJpVh+6qzUqp2bU3eaRpdiQeKGlKitaH0PM8=
github.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo=
github.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs=
github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g=
github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
Expand Down
Loading

0 comments on commit 9ca0ccd

Please sign in to comment.