Skip to content

Commit fa7591e

Browse files
authored
fix: validate that a method and a wildcard won't appear together (#3667)
* fix: validate that a method and a wildcard won't appear together * fix: use `in` instead of `includes`
1 parent 72103a7 commit fa7591e

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

apis/v1/httproute_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,7 @@ type HTTPCORSFilter struct {
14171417
//
14181418
// +listType=set
14191419
// +kubebuilder:validation:MaxItems=9
1420+
// +kubebuilder:validation:XValidation:message="AllowMethods cannot contain '*' alongside other methods",rule="!('*' in self && self.size() > 1)"
14201421
AllowMethods []HTTPMethodWithWildcard `json:"allowMethods,omitempty"`
14211422

14221423
// AllowHeaders indicates which HTTP request headers are supported for

config/crd/experimental/gateway.networking.k8s.io_httproutes.yaml

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)