From 97501fbb6ec0fe6a6e70aa64b87de62d0782e6e3 Mon Sep 17 00:00:00 2001 From: zirain Date: Tue, 18 Feb 2025 11:44:38 +0800 Subject: [PATCH 1/5] api: support customized UpgradeConfigs Signed-off-by: zirain --- api/v1alpha1/backendtrafficpolicy_types.go | 28 ++++++++++++----- api/v1alpha1/zz_generated.deepcopy.go | 31 +++++++++++++++++++ ....envoyproxy.io_backendtrafficpolicies.yaml | 17 ++++++++++ site/content/en/latest/api/extension_types.md | 16 ++++++++++ 4 files changed, 85 insertions(+), 7 deletions(-) diff --git a/api/v1alpha1/backendtrafficpolicy_types.go b/api/v1alpha1/backendtrafficpolicy_types.go index 79b0e5a540..bd3a4f5a19 100644 --- a/api/v1alpha1/backendtrafficpolicy_types.go +++ b/api/v1alpha1/backendtrafficpolicy_types.go @@ -15,13 +15,13 @@ const ( KindBackendTrafficPolicy = "BackendTrafficPolicy" ) +// BackendTrafficPolicy allows the user to configure the behavior of the connection +// between the Envoy Proxy listener and the backend service. +// // +kubebuilder:object:root=true // +kubebuilder:resource:categories=envoy-gateway,shortName=btp // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` - -// BackendTrafficPolicy allows the user to configure the behavior of the connection -// between the Envoy Proxy listener and the backend service. type BackendTrafficPolicy struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -33,16 +33,15 @@ type BackendTrafficPolicy struct { Status gwapiv1a2.PolicyStatus `json:"status,omitempty"` } -// +kubebuilder:validation:XValidation:rule="(has(self.targetRef) && !has(self.targetRefs)) || (!has(self.targetRef) && has(self.targetRefs)) || (has(self.targetSelectors) && self.targetSelectors.size() > 0) ", message="either targetRef or targetRefs must be used" +// BackendTrafficPolicySpec defines the desired state of BackendTrafficPolicy. // +// +kubebuilder:validation:XValidation:rule="(has(self.targetRef) && !has(self.targetRefs)) || (!has(self.targetRef) && has(self.targetRefs)) || (has(self.targetSelectors) && self.targetSelectors.size() > 0) ", message="either targetRef or targetRefs must be used" // +kubebuilder:validation:XValidation:rule="has(self.targetRef) ? self.targetRef.group == 'gateway.networking.k8s.io' : true ", message="this policy can only have a targetRef.group of gateway.networking.k8s.io" // +kubebuilder:validation:XValidation:rule="has(self.targetRef) ? self.targetRef.kind in ['Gateway', 'HTTPRoute', 'GRPCRoute', 'UDPRoute', 'TCPRoute', 'TLSRoute'] : true", message="this policy can only have a targetRef.kind of Gateway/HTTPRoute/GRPCRoute/TCPRoute/UDPRoute/TLSRoute" // +kubebuilder:validation:XValidation:rule="has(self.targetRef) ? !has(self.targetRef.sectionName) : true",message="this policy does not yet support the sectionName field" // +kubebuilder:validation:XValidation:rule="has(self.targetRefs) ? self.targetRefs.all(ref, ref.group == 'gateway.networking.k8s.io') : true ", message="this policy can only have a targetRefs[*].group of gateway.networking.k8s.io" // +kubebuilder:validation:XValidation:rule="has(self.targetRefs) ? self.targetRefs.all(ref, ref.kind in ['Gateway', 'HTTPRoute', 'GRPCRoute', 'UDPRoute', 'TCPRoute', 'TLSRoute']) : true ", message="this policy can only have a targetRefs[*].kind of Gateway/HTTPRoute/GRPCRoute/TCPRoute/UDPRoute/TLSRoute" // +kubebuilder:validation:XValidation:rule="has(self.targetRefs) ? self.targetRefs.all(ref, !has(ref.sectionName)) : true",message="this policy does not yet support the sectionName field" -// -// BackendTrafficPolicySpec defines the desired state of BackendTrafficPolicy. type BackendTrafficPolicySpec struct { PolicyTargetReferences `json:",inline"` ClusterSettings `json:",inline"` @@ -74,11 +73,26 @@ type BackendTrafficPolicySpec struct { // // +optional ResponseOverride []*ResponseOverride `json:"responseOverride,omitempty"` + // UpgradeConfigs defines the configuration for protocol upgrades. + // If not specified, the default upgrade configuration(websocket) will be used. + // + // +optional + UpgradeConfigs []*BackendUpgradeConfig `json:"upgradeConfigs,omitempty"` } -// +kubebuilder:object:root=true +type BackendUpgradeConfig struct { + // UpgradeType is the case-insensitive name of protocol upgrade. + // + // +kubebuilder:validation:Required + UpgradeType string `json:"upgradeType"` + // Disabled indicates whether the upgrade is disabled. + // +optional + Disabled *bool `json:"disabled"` +} // BackendTrafficPolicyList contains a list of BackendTrafficPolicy resources. +// +// +kubebuilder:object:root=true type BackendTrafficPolicyList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 5efdb1bde9..85495f74d7 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -626,6 +626,17 @@ func (in *BackendTrafficPolicySpec) DeepCopyInto(out *BackendTrafficPolicySpec) } } } + if in.UpgradeConfigs != nil { + in, out := &in.UpgradeConfigs, &out.UpgradeConfigs + *out = make([]*BackendUpgradeConfig, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(BackendUpgradeConfig) + (*in).DeepCopyInto(*out) + } + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicySpec. @@ -638,6 +649,26 @@ func (in *BackendTrafficPolicySpec) DeepCopy() *BackendTrafficPolicySpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackendUpgradeConfig) DeepCopyInto(out *BackendUpgradeConfig) { + *out = *in + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendUpgradeConfig. +func (in *BackendUpgradeConfig) DeepCopy() *BackendUpgradeConfig { + if in == nil { + return nil + } + out := new(BackendUpgradeConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BasicAuth) DeepCopyInto(out *BasicAuth) { *out = *in diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml index 1471f7fa39..54c8db0a93 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml @@ -1632,6 +1632,23 @@ spec: type: string type: object type: object + upgradeConfigs: + description: |- + UpgradeConfigs defines the configuration for protocol upgrades. + If not specified, the default upgrade configuration(websocket) will be used. + items: + properties: + disabled: + description: Disabled indicates whether the upgrade is disabled. + type: boolean + upgradeType: + description: UpgradeType is the case-insensitive name of protocol + upgrade. + type: string + required: + - upgradeType + type: object + type: array useClientProtocol: description: |- UseClientProtocol configures Envoy to prefer sending requests to backends using diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index 47972765e0..199f9e0839 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -485,6 +485,22 @@ _Appears in:_ | `useClientProtocol` | _boolean_ | false | | UseClientProtocol configures Envoy to prefer sending requests to backends using
the same HTTP protocol that the incoming request used. Defaults to false, which means
that Envoy will use the protocol indicated by the attached BackendRef. | | `compression` | _[Compression](#compression) array_ | false | | The compression config for the http streams. | | `responseOverride` | _[ResponseOverride](#responseoverride) array_ | false | | ResponseOverride defines the configuration to override specific responses with a custom one.
If multiple configurations are specified, the first one to match wins. | +| `upgradeConfigs` | _[BackendUpgradeConfig](#backendupgradeconfig) array_ | false | | UpgradeConfigs defines the configuration for protocol upgrades.
If not specified, the default upgrade configuration(websocket) will be used. | + + +#### BackendUpgradeConfig + + + + + +_Appears in:_ +- [BackendTrafficPolicySpec](#backendtrafficpolicyspec) + +| Field | Type | Required | Default | Description | +| --- | --- | --- | --- | --- | +| `upgradeType` | _string_ | true | | UpgradeType is the case-insensitive name of protocol upgrade. | +| `disabled` | _boolean_ | false | | Disabled indicates whether the upgrade is disabled. | #### BasicAuth From 5c79e0cc5bd3e809c22c117ba91695f848dc1b8e Mon Sep 17 00:00:00 2001 From: zirain Date: Wed, 19 Feb 2025 09:05:39 +0800 Subject: [PATCH 2/5] update Signed-off-by: zirain --- api/v1alpha1/backendtrafficpolicy_types.go | 10 ++-- api/v1alpha1/zz_generated.deepcopy.go | 48 +++++++++---------- ....envoyproxy.io_backendtrafficpolicies.yaml | 34 ++++++------- site/content/en/latest/api/extension_types.md | 32 ++++++------- 4 files changed, 62 insertions(+), 62 deletions(-) diff --git a/api/v1alpha1/backendtrafficpolicy_types.go b/api/v1alpha1/backendtrafficpolicy_types.go index bd3a4f5a19..722847fd2b 100644 --- a/api/v1alpha1/backendtrafficpolicy_types.go +++ b/api/v1alpha1/backendtrafficpolicy_types.go @@ -73,18 +73,18 @@ type BackendTrafficPolicySpec struct { // // +optional ResponseOverride []*ResponseOverride `json:"responseOverride,omitempty"` - // UpgradeConfigs defines the configuration for protocol upgrades. + // HTTPUpgrade defines the configuration for HTTP protocol upgrades. // If not specified, the default upgrade configuration(websocket) will be used. // // +optional - UpgradeConfigs []*BackendUpgradeConfig `json:"upgradeConfigs,omitempty"` + HTTPUpgrade []*ProtocolUpgradeConfig `json:"httpUpgrade,omitempty"` } -type BackendUpgradeConfig struct { - // UpgradeType is the case-insensitive name of protocol upgrade. +type ProtocolUpgradeConfig struct { + // Protocol is the case-insensitive name of protocol upgrade. // // +kubebuilder:validation:Required - UpgradeType string `json:"upgradeType"` + Protocol string `json:"protocol"` // Disabled indicates whether the upgrade is disabled. // +optional Disabled *bool `json:"disabled"` diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 85495f74d7..97fddd3ff6 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -626,13 +626,13 @@ func (in *BackendTrafficPolicySpec) DeepCopyInto(out *BackendTrafficPolicySpec) } } } - if in.UpgradeConfigs != nil { - in, out := &in.UpgradeConfigs, &out.UpgradeConfigs - *out = make([]*BackendUpgradeConfig, len(*in)) + if in.HTTPUpgrade != nil { + in, out := &in.HTTPUpgrade, &out.HTTPUpgrade + *out = make([]*ProtocolUpgradeConfig, len(*in)) for i := range *in { if (*in)[i] != nil { in, out := &(*in)[i], &(*out)[i] - *out = new(BackendUpgradeConfig) + *out = new(ProtocolUpgradeConfig) (*in).DeepCopyInto(*out) } } @@ -649,26 +649,6 @@ func (in *BackendTrafficPolicySpec) DeepCopy() *BackendTrafficPolicySpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackendUpgradeConfig) DeepCopyInto(out *BackendUpgradeConfig) { - *out = *in - if in.Disabled != nil { - in, out := &in.Disabled, &out.Disabled - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendUpgradeConfig. -func (in *BackendUpgradeConfig) DeepCopy() *BackendUpgradeConfig { - if in == nil { - return nil - } - out := new(BackendUpgradeConfig) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BasicAuth) DeepCopyInto(out *BasicAuth) { *out = *in @@ -4444,6 +4424,26 @@ func (in *ProcessingModeOptions) DeepCopy() *ProcessingModeOptions { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProtocolUpgradeConfig) DeepCopyInto(out *ProtocolUpgradeConfig) { + *out = *in + if in.Disabled != nil { + in, out := &in.Disabled, &out.Disabled + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProtocolUpgradeConfig. +func (in *ProtocolUpgradeConfig) DeepCopy() *ProtocolUpgradeConfig { + if in == nil { + return nil + } + out := new(ProtocolUpgradeConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProxyAccessLog) DeepCopyInto(out *ProxyAccessLog) { *out = *in diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml index 54c8db0a93..4793ec8f1b 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml @@ -532,6 +532,23 @@ spec: Default: TerminateConnection type: string type: object + httpUpgrade: + description: |- + HTTPUpgrade defines the configuration for HTTP protocol upgrades. + If not specified, the default upgrade configuration(websocket) will be used. + items: + properties: + disabled: + description: Disabled indicates whether the upgrade is disabled. + type: boolean + protocol: + description: Protocol is the case-insensitive name of protocol + upgrade. + type: string + required: + - protocol + type: object + type: array loadBalancer: description: |- LoadBalancer policy to apply when routing traffic from the gateway to @@ -1632,23 +1649,6 @@ spec: type: string type: object type: object - upgradeConfigs: - description: |- - UpgradeConfigs defines the configuration for protocol upgrades. - If not specified, the default upgrade configuration(websocket) will be used. - items: - properties: - disabled: - description: Disabled indicates whether the upgrade is disabled. - type: boolean - upgradeType: - description: UpgradeType is the case-insensitive name of protocol - upgrade. - type: string - required: - - upgradeType - type: object - type: array useClientProtocol: description: |- UseClientProtocol configures Envoy to prefer sending requests to backends using diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index 199f9e0839..b73ecf81b0 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -485,22 +485,7 @@ _Appears in:_ | `useClientProtocol` | _boolean_ | false | | UseClientProtocol configures Envoy to prefer sending requests to backends using
the same HTTP protocol that the incoming request used. Defaults to false, which means
that Envoy will use the protocol indicated by the attached BackendRef. | | `compression` | _[Compression](#compression) array_ | false | | The compression config for the http streams. | | `responseOverride` | _[ResponseOverride](#responseoverride) array_ | false | | ResponseOverride defines the configuration to override specific responses with a custom one.
If multiple configurations are specified, the first one to match wins. | -| `upgradeConfigs` | _[BackendUpgradeConfig](#backendupgradeconfig) array_ | false | | UpgradeConfigs defines the configuration for protocol upgrades.
If not specified, the default upgrade configuration(websocket) will be used. | - - -#### BackendUpgradeConfig - - - - - -_Appears in:_ -- [BackendTrafficPolicySpec](#backendtrafficpolicyspec) - -| Field | Type | Required | Default | Description | -| --- | --- | --- | --- | --- | -| `upgradeType` | _string_ | true | | UpgradeType is the case-insensitive name of protocol upgrade. | -| `disabled` | _boolean_ | false | | Disabled indicates whether the upgrade is disabled. | +| `httpUpgrade` | _[ProtocolUpgradeConfig](#protocolupgradeconfig) array_ | false | | HTTPUpgrade defines the configuration for HTTP protocol upgrades.
If not specified, the default upgrade configuration(websocket) will be used. | #### BasicAuth @@ -3185,6 +3170,21 @@ _Appears in:_ | `attributes` | _string array_ | false | | Defines which attributes are sent to the external processor. Envoy Gateway currently
supports only the following attribute prefixes: connection, source, destination,
request, response, upstream and xds.route.
https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/advanced/attributes | +#### ProtocolUpgradeConfig + + + + + +_Appears in:_ +- [BackendTrafficPolicySpec](#backendtrafficpolicyspec) + +| Field | Type | Required | Default | Description | +| --- | --- | --- | --- | --- | +| `protocol` | _string_ | true | | Protocol is the case-insensitive name of protocol upgrade. | +| `disabled` | _boolean_ | false | | Disabled indicates whether the upgrade is disabled. | + + #### ProviderType _Underlying type:_ _string_ From 9d07ff9edb57eae95376c50191f0904e43b59c25 Mon Sep 17 00:00:00 2001 From: zirain Date: Wed, 19 Feb 2025 09:25:28 +0800 Subject: [PATCH 3/5] hide Signed-off-by: zirain --- api/v1alpha1/backendtrafficpolicy_types.go | 1 + site/content/en/latest/api/extension_types.md | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1alpha1/backendtrafficpolicy_types.go b/api/v1alpha1/backendtrafficpolicy_types.go index 722847fd2b..50ce6570d9 100644 --- a/api/v1alpha1/backendtrafficpolicy_types.go +++ b/api/v1alpha1/backendtrafficpolicy_types.go @@ -77,6 +77,7 @@ type BackendTrafficPolicySpec struct { // If not specified, the default upgrade configuration(websocket) will be used. // // +optional + // +notImplementedHide HTTPUpgrade []*ProtocolUpgradeConfig `json:"httpUpgrade,omitempty"` } diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index b73ecf81b0..722a647ba1 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -485,7 +485,6 @@ _Appears in:_ | `useClientProtocol` | _boolean_ | false | | UseClientProtocol configures Envoy to prefer sending requests to backends using
the same HTTP protocol that the incoming request used. Defaults to false, which means
that Envoy will use the protocol indicated by the attached BackendRef. | | `compression` | _[Compression](#compression) array_ | false | | The compression config for the http streams. | | `responseOverride` | _[ResponseOverride](#responseoverride) array_ | false | | ResponseOverride defines the configuration to override specific responses with a custom one.
If multiple configurations are specified, the first one to match wins. | -| `httpUpgrade` | _[ProtocolUpgradeConfig](#protocolupgradeconfig) array_ | false | | HTTPUpgrade defines the configuration for HTTP protocol upgrades.
If not specified, the default upgrade configuration(websocket) will be used. | #### BasicAuth From e9fa1a385f6952437abe1f19adf9b088c6669fa8 Mon Sep 17 00:00:00 2001 From: zirain Date: Wed, 19 Feb 2025 13:42:28 +0800 Subject: [PATCH 4/5] update Signed-off-by: zirain --- api/v1alpha1/backendtrafficpolicy_types.go | 1 + .../gateway.envoyproxy.io_backendtrafficpolicies.yaml | 5 +++-- site/content/en/latest/api/extension_types.md | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/api/v1alpha1/backendtrafficpolicy_types.go b/api/v1alpha1/backendtrafficpolicy_types.go index 50ce6570d9..d503c8150e 100644 --- a/api/v1alpha1/backendtrafficpolicy_types.go +++ b/api/v1alpha1/backendtrafficpolicy_types.go @@ -83,6 +83,7 @@ type BackendTrafficPolicySpec struct { type ProtocolUpgradeConfig struct { // Protocol is the case-insensitive name of protocol upgrade. + // e.g. `websocket`, `CONNECT`, `spdy/3.1` etc. // // +kubebuilder:validation:Required Protocol string `json:"protocol"` diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml index 4793ec8f1b..4201ccadca 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml @@ -542,8 +542,9 @@ spec: description: Disabled indicates whether the upgrade is disabled. type: boolean protocol: - description: Protocol is the case-insensitive name of protocol - upgrade. + description: |- + Protocol is the case-insensitive name of protocol upgrade. + e.g. `websocket`, `CONNECT`, `spdy/3.1` etc. type: string required: - protocol diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index 722a647ba1..61408c26f2 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -3180,7 +3180,7 @@ _Appears in:_ | Field | Type | Required | Default | Description | | --- | --- | --- | --- | --- | -| `protocol` | _string_ | true | | Protocol is the case-insensitive name of protocol upgrade. | +| `protocol` | _string_ | true | | Protocol is the case-insensitive name of protocol upgrade.
e.g. `websocket`, `CONNECT`, `spdy/3.1` etc. | | `disabled` | _boolean_ | false | | Disabled indicates whether the upgrade is disabled. | From 7a8424dadd140d37d6771aede12bca0c9b855a32 Mon Sep 17 00:00:00 2001 From: zirain Date: Thu, 27 Feb 2025 14:23:42 +0800 Subject: [PATCH 5/5] rename to Type Signed-off-by: zirain --- api/v1alpha1/backendtrafficpolicy_types.go | 4 ++-- .../gateway.envoyproxy.io_backendtrafficpolicies.yaml | 6 +++--- site/content/en/latest/api/extension_types.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/v1alpha1/backendtrafficpolicy_types.go b/api/v1alpha1/backendtrafficpolicy_types.go index d503c8150e..d230e2a4ca 100644 --- a/api/v1alpha1/backendtrafficpolicy_types.go +++ b/api/v1alpha1/backendtrafficpolicy_types.go @@ -82,11 +82,11 @@ type BackendTrafficPolicySpec struct { } type ProtocolUpgradeConfig struct { - // Protocol is the case-insensitive name of protocol upgrade. + // Type is the case-insensitive type of protocol upgrade. // e.g. `websocket`, `CONNECT`, `spdy/3.1` etc. // // +kubebuilder:validation:Required - Protocol string `json:"protocol"` + Type string `json:"type"` // Disabled indicates whether the upgrade is disabled. // +optional Disabled *bool `json:"disabled"` diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml index 4201ccadca..2fcf2c47f6 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml @@ -541,13 +541,13 @@ spec: disabled: description: Disabled indicates whether the upgrade is disabled. type: boolean - protocol: + type: description: |- - Protocol is the case-insensitive name of protocol upgrade. + Type is the case-insensitive type of protocol upgrade. e.g. `websocket`, `CONNECT`, `spdy/3.1` etc. type: string required: - - protocol + - type type: object type: array loadBalancer: diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index 61408c26f2..028ffb8a79 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -3180,7 +3180,7 @@ _Appears in:_ | Field | Type | Required | Default | Description | | --- | --- | --- | --- | --- | -| `protocol` | _string_ | true | | Protocol is the case-insensitive name of protocol upgrade.
e.g. `websocket`, `CONNECT`, `spdy/3.1` etc. | +| `type` | _string_ | true | | Type is the case-insensitive type of protocol upgrade.
e.g. `websocket`, `CONNECT`, `spdy/3.1` etc. | | `disabled` | _boolean_ | false | | Disabled indicates whether the upgrade is disabled. |