From 6064cc24ecd691c22185e78a0c5c35e6b19fc4c0 Mon Sep 17 00:00:00 2001 From: Taufik Mulyana Date: Sat, 30 Nov 2024 23:04:19 +0700 Subject: [PATCH 1/2] chore: increase backend endpoints max item to 64 Signed-off-by: Taufik Mulyana --- api/v1alpha1/backend_types.go | 2 +- test/cel-validation/backend_test.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api/v1alpha1/backend_types.go b/api/v1alpha1/backend_types.go index 563bb5d2019..6afbcf9d182 100644 --- a/api/v1alpha1/backend_types.go +++ b/api/v1alpha1/backend_types.go @@ -116,7 +116,7 @@ type BackendSpec struct { // Endpoints defines the endpoints to be used when connecting to the backend. // // +kubebuilder:validation:MinItems=1 - // +kubebuilder:validation:MaxItems=4 + // +kubebuilder:validation:MaxItems=64 // +kubebuilder:validation:XValidation:rule="self.all(f, has(f.fqdn)) || !self.exists(f, has(f.fqdn))",message="fqdn addresses cannot be mixed with other address types" Endpoints []BackendEndpoint `json:"endpoints,omitempty"` diff --git a/test/cel-validation/backend_test.go b/test/cel-validation/backend_test.go index a46a2d4078a..b8536c3d885 100644 --- a/test/cel-validation/backend_test.go +++ b/test/cel-validation/backend_test.go @@ -75,6 +75,12 @@ func TestBackend(t *testing.T) { Port: 443, }, }, + { + FQDN: &egv1a1.FQDNEndpoint{ + Hostname: "sub1.s.sub.example.com", + Port: 443, + }, + }, }, } }, From 512456c22260decb7d94065886df1950a2d3266d Mon Sep 17 00:00:00 2001 From: Taufik Mulyana Date: Sun, 1 Dec 2024 12:19:53 +0700 Subject: [PATCH 2/2] fix test Signed-off-by: Taufik Mulyana --- .../crds/generated/gateway.envoyproxy.io_backends.yaml | 2 +- test/cel-validation/backend_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backends.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backends.yaml index 7d0da8385be..9dd148bf42b 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backends.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backends.yaml @@ -132,7 +132,7 @@ spec: rule: ((has(self.fqdn) && !(has(self.ip) || has(self.unix))) || (has(self.ip) && !(has(self.fqdn) || has(self.unix))) || (has(self.unix) && !(has(self.ip) || has(self.fqdn)))) - maxItems: 4 + maxItems: 64 minItems: 1 type: array x-kubernetes-validations: diff --git a/test/cel-validation/backend_test.go b/test/cel-validation/backend_test.go index b8536c3d885..069a9f74f78 100644 --- a/test/cel-validation/backend_test.go +++ b/test/cel-validation/backend_test.go @@ -77,7 +77,7 @@ func TestBackend(t *testing.T) { }, { FQDN: &egv1a1.FQDNEndpoint{ - Hostname: "sub1.s.sub.example.com", + Hostname: "sub1.sub.sub.example.com", Port: 443, }, },