Skip to content

Commit

Permalink
Removed CEL validation that prevents specifying a SectionName for
Browse files Browse the repository at this point in the history
ClientTrafficPolicy resources.

Signed-off-by: Lior Okman <[email protected]>
  • Loading branch information
liorokman committed Jun 10, 2024
1 parent 33fceb0 commit 6a73383
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
1 change: 0 additions & 1 deletion api/v1alpha1/clienttrafficpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ type ClientTrafficPolicy struct {
type ClientTrafficPolicySpec struct {
// +kubebuilder:validation:XValidation:rule="self.group == 'gateway.networking.k8s.io'", message="this policy can only have a targetRef.group of gateway.networking.k8s.io"
// +kubebuilder:validation:XValidation:rule="self.kind == 'Gateway'", message="this policy can only have a targetRef.kind of Gateway"
// +kubebuilder:validation:XValidation:rule="!has(self.sectionName)",message="this policy does not yet support the sectionName field"
//
// TargetRef is the name of the Gateway resource this policy
// is being attached to.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,6 @@ spec:
rule: self.group == 'gateway.networking.k8s.io'
- message: this policy can only have a targetRef.kind of Gateway
rule: self.kind == 'Gateway'
- message: this policy does not yet support the sectionName field
rule: '!has(self.sectionName)'
tcpKeepalive:
description: |-
TcpKeepalive settings associated with the downstream client connection.
Expand Down
17 changes: 0 additions & 17 deletions test/cel-validation/clienttrafficpolicy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,6 @@ func TestClientTrafficPolicyTarget(t *testing.T) {
"spec.targetRef: Invalid value: \"object\": this policy can only have a targetRef.kind of Gateway",
},
},
{
desc: "sectionName disabled until supported",
mutate: func(ctp *egv1a1.ClientTrafficPolicy) {
ctp.Spec = egv1a1.ClientTrafficPolicySpec{
TargetRef: gwapiv1a2.LocalPolicyTargetReferenceWithSectionName{
LocalPolicyTargetReference: gwapiv1a2.LocalPolicyTargetReference{
Group: gwapiv1a2.Group("gateway.networking.k8s.io"),
Kind: gwapiv1a2.Kind("Gateway"),
},
SectionName: &sectionName,
},
}
},
wantErrors: []string{
"spec.targetRef: Invalid value: \"object\": this policy does not yet support the sectionName field",
},
},
{
desc: "tls minimal version greater than tls maximal version",
mutate: func(ctp *egv1a1.ClientTrafficPolicy) {
Expand Down

0 comments on commit 6a73383

Please sign in to comment.