Skip to content

Commit

Permalink
chore: increase backend endpoints max items to 64 (#4822)
Browse files Browse the repository at this point in the history
* chore: increase backend endpoints max item to 64

Signed-off-by: Taufik Mulyana <[email protected]>

* fix test

Signed-off-by: Taufik Mulyana <[email protected]>

---------

Signed-off-by: Taufik Mulyana <[email protected]>
Co-authored-by: Huabing Zhao <[email protected]>
  • Loading branch information
nothinux and zhaohuabing authored Dec 2, 2024
1 parent cf75b16 commit 93ac055
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/backend_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions test/cel-validation/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ func TestBackend(t *testing.T) {
Port: 443,
},
},
{
FQDN: &egv1a1.FQDNEndpoint{
Hostname: "sub1.sub.sub.example.com",
Port: 443,
},
},
},
}
},
Expand Down

0 comments on commit 93ac055

Please sign in to comment.