From 6ca99f6debd0318c624bbb019339d28855f7e8a4 Mon Sep 17 00:00:00 2001 From: zirain Date: Tue, 3 Dec 2024 08:42:08 +0800 Subject: [PATCH] api: remove Compression from btp Signed-off-by: zirain --- api/v1alpha1/backendtrafficpolicy_types.go | 11 ++-------- api/v1alpha1/zz_generated.deepcopy.go | 11 ---------- ....envoyproxy.io_backendtrafficpolicies.yaml | 20 ------------------- site/content/en/latest/api/extension_types.md | 1 - site/content/zh/latest/api/extension_types.md | 1 - 5 files changed, 2 insertions(+), 42 deletions(-) diff --git a/api/v1alpha1/backendtrafficpolicy_types.go b/api/v1alpha1/backendtrafficpolicy_types.go index 4183c12830f..422823c0b29 100644 --- a/api/v1alpha1/backendtrafficpolicy_types.go +++ b/api/v1alpha1/backendtrafficpolicy_types.go @@ -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"` @@ -64,12 +63,6 @@ type BackendTrafficPolicySpec struct { // +optional UseClientProtocol *bool `json:"useClientProtocol,omitempty"` - // The compression config for the http streams. - // - // +optional - // +notImplementedHide - Compression []*Compression `json:"compression,omitempty"` - // ResponseOverride defines the configuration to override specific responses with a custom one. // If multiple configurations are specified, the first one to match wins. // diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 457afa58ac4..71f943b47a1 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -545,17 +545,6 @@ func (in *BackendTrafficPolicySpec) DeepCopyInto(out *BackendTrafficPolicySpec) *out = new(bool) **out = **in } - if in.Compression != nil { - in, out := &in.Compression, &out.Compression - *out = make([]*Compression, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(Compression) - (*in).DeepCopyInto(*out) - } - } - } if in.ResponseOverride != nil { in, out := &in.ResponseOverride, &out.ResponseOverride *out = make([]*ResponseOverride, len(*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 f9fb0f329dd..4ccce27bde6 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml @@ -99,26 +99,6 @@ spec: minimum: 0 type: integer type: object - compression: - description: The compression config for the http streams. - items: - description: |- - Compression defines the config of enabling compression. - This can help reduce the bandwidth at the expense of higher CPU. - properties: - gzip: - description: The configuration for GZIP compressor. - type: object - type: - description: CompressorType defines the compressor type to use - for compression. - enum: - - Gzip - type: string - required: - - type - type: object - type: array connection: description: Connection includes backend connection settings. properties: diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index fc7142446c1..bcee0a46152 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -720,7 +720,6 @@ Compression defines the config of enabling compression. This can help reduce the bandwidth at the expense of higher CPU. _Appears in:_ -- [BackendTrafficPolicySpec](#backendtrafficpolicyspec) - [ProxyPrometheusProvider](#proxyprometheusprovider) | Field | Type | Required | Description | diff --git a/site/content/zh/latest/api/extension_types.md b/site/content/zh/latest/api/extension_types.md index fc7142446c1..bcee0a46152 100644 --- a/site/content/zh/latest/api/extension_types.md +++ b/site/content/zh/latest/api/extension_types.md @@ -720,7 +720,6 @@ Compression defines the config of enabling compression. This can help reduce the bandwidth at the expense of higher CPU. _Appears in:_ -- [BackendTrafficPolicySpec](#backendtrafficpolicyspec) - [ProxyPrometheusProvider](#proxyprometheusprovider) | Field | Type | Required | Description |