Skip to content

Commit 35419e3

Browse files
author
i.makarychev
committed
rename queryParam
Signed-off-by: i.makarychev <[email protected]> Signed-off-by: i.makarychev <[email protected]>
1 parent 9935819 commit 35419e3

26 files changed

+847
-8
lines changed

api/v1alpha1/loadbalancer_types.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,25 @@ const (
6565
RoundRobinLoadBalancerType LoadBalancerType = "RoundRobin"
6666
)
6767

68+
// QueryParamName defines the query parameter name hashing configuration for consistent hash based
69+
// load balancing.
70+
type QueryParam string
71+
6872
// ConsistentHash defines the configuration related to the consistent hash
6973
// load balancer policy.
7074
// +union
7175
//
7276
// +kubebuilder:validation:XValidation:rule="self.type == 'Header' ? has(self.header) : !has(self.header)",message="If consistent hash type is header, the header field must be set."
7377
// +kubebuilder:validation:XValidation:rule="self.type == 'Headers' ? has(self.headers) : !has(self.headers)",message="If consistent hash type is headers, the headers field must be set."
7478
// +kubebuilder:validation:XValidation:rule="self.type == 'Cookie' ? has(self.cookie) : !has(self.cookie)",message="If consistent hash type is cookie, the cookie field must be set."
79+
// +kubebuilder:validation:XValidation:rule="self.type == 'QueryParam' ? has(self.queryParam) : !has(self.queryParam)",message="If consistent hash type is queryParam, the queryParam field must be set."
7580
type ConsistentHash struct {
7681
// ConsistentHashType defines the type of input to hash on. Valid Type values are
7782
// "SourceIP",
7883
// "Header",
7984
// "Headers",
8085
// "Cookie".
86+
// "QueryParam".
8187
//
8288
// +unionDiscriminator
8389
Type ConsistentHashType `json:"type"`
@@ -98,6 +104,11 @@ type ConsistentHash struct {
98104
// +optional
99105
Cookie *Cookie `json:"cookie,omitempty"`
100106

107+
// QueryParam configures the query parameter hash policy when the consistent hash type is set to QueryParam.
108+
//
109+
// +optional
110+
QueryParam *QueryParam `json:"queryParam,omitempty"`
111+
101112
// The table size for consistent hashing, must be prime number limited to 5000011.
102113
//
103114
// +kubebuilder:validation:Minimum=2
@@ -135,7 +146,7 @@ type Cookie struct {
135146
}
136147

137148
// ConsistentHashType defines the type of input to hash on.
138-
// +kubebuilder:validation:Enum=SourceIP;Header;Headers;Cookie
149+
// +kubebuilder:validation:Enum=SourceIP;Header;Headers;Cookie;QueryParam
139150
type ConsistentHashType string
140151

141152
const (
@@ -149,6 +160,8 @@ const (
149160
HeadersConsistentHashType ConsistentHashType = "Headers"
150161
// CookieConsistentHashType hashes based on a cookie.
151162
CookieConsistentHashType ConsistentHashType = "Cookie"
163+
// QueryParamConsistentHashType hashes based on a query parameter.
164+
QueryParamConsistentHashType ConsistentHashType = "QueryParam"
152165
)
153166

154167
// SlowStart defines the configuration related to the slow start load balancer policy.

api/v1alpha1/zz_generated.deepcopy.go

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

charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,10 @@ spec:
736736
- name
737737
type: object
738738
type: array
739+
queryParam:
740+
description: QueryParam configures the query parameter hash
741+
policy when the consistent hash type is set to QueryParam.
742+
type: string
739743
tableSize:
740744
default: 65537
741745
description: The table size for consistent hashing, must be
@@ -751,11 +755,13 @@ spec:
751755
"Header",
752756
"Headers",
753757
"Cookie".
758+
"QueryParam".
754759
enum:
755760
- SourceIP
756761
- Header
757762
- Headers
758763
- Cookie
764+
- QueryParam
759765
type: string
760766
required:
761767
- type
@@ -770,6 +776,10 @@ spec:
770776
- message: If consistent hash type is cookie, the cookie field
771777
must be set.
772778
rule: 'self.type == ''Cookie'' ? has(self.cookie) : !has(self.cookie)'
779+
- message: If consistent hash type is queryParam, the queryParam
780+
field must be set.
781+
rule: 'self.type == ''QueryParam'' ? has(self.queryParam) :
782+
!has(self.queryParam)'
773783
endpointOverride:
774784
description: |-
775785
EndpointOverride defines the configuration for endpoint override.

charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,11 @@ spec:
776776
- name
777777
type: object
778778
type: array
779+
queryParam:
780+
description: QueryParam configures the query parameter
781+
hash policy when the consistent hash type is set
782+
to QueryParam.
783+
type: string
779784
tableSize:
780785
default: 65537
781786
description: The table size for consistent hashing,
@@ -791,11 +796,13 @@ spec:
791796
"Header",
792797
"Headers",
793798
"Cookie".
799+
"QueryParam".
794800
enum:
795801
- SourceIP
796802
- Header
797803
- Headers
798804
- Cookie
805+
- QueryParam
799806
type: string
800807
required:
801808
- type
@@ -813,6 +820,10 @@ spec:
813820
field must be set.
814821
rule: 'self.type == ''Cookie'' ? has(self.cookie)
815822
: !has(self.cookie)'
823+
- message: If consistent hash type is queryParam, the
824+
queryParam field must be set.
825+
rule: 'self.type == ''QueryParam'' ? has(self.queryParam)
826+
: !has(self.queryParam)'
816827
endpointOverride:
817828
description: |-
818829
EndpointOverride defines the configuration for endpoint override.

charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11751,6 +11751,12 @@ spec:
1175111751
- name
1175211752
type: object
1175311753
type: array
11754+
queryParam:
11755+
description: QueryParam configures
11756+
the query parameter hash policy
11757+
when the consistent hash type
11758+
is set to QueryParam.
11759+
type: string
1175411760
tableSize:
1175511761
default: 65537
1175611762
description: The table size for
@@ -11767,11 +11773,13 @@ spec:
1176711773
"Header",
1176811774
"Headers",
1176911775
"Cookie".
11776+
"QueryParam".
1177011777
enum:
1177111778
- SourceIP
1177211779
- Header
1177311780
- Headers
1177411781
- Cookie
11782+
- QueryParam
1177511783
type: string
1177611784
required:
1177711785
- type
@@ -11792,6 +11800,11 @@ spec:
1179211800
be set.
1179311801
rule: 'self.type == ''Cookie'' ?
1179411802
has(self.cookie) : !has(self.cookie)'
11803+
- message: If consistent hash type
11804+
is queryParam, the queryParam
11805+
field must be set.
11806+
rule: 'self.type == ''QueryParam''
11807+
? has(self.queryParam) : !has(self.queryParam)'
1179511808
endpointOverride:
1179611809
description: |-
1179711810
EndpointOverride defines the configuration for endpoint override.
@@ -12958,6 +12971,12 @@ spec:
1295812971
- name
1295912972
type: object
1296012973
type: array
12974+
queryParam:
12975+
description: QueryParam configures
12976+
the query parameter hash policy
12977+
when the consistent hash type
12978+
is set to QueryParam.
12979+
type: string
1296112980
tableSize:
1296212981
default: 65537
1296312982
description: The table size for
@@ -12974,11 +12993,13 @@ spec:
1297412993
"Header",
1297512994
"Headers",
1297612995
"Cookie".
12996+
"QueryParam".
1297712997
enum:
1297812998
- SourceIP
1297912999
- Header
1298013000
- Headers
1298113001
- Cookie
13002+
- QueryParam
1298213003
type: string
1298313004
required:
1298413005
- type
@@ -12999,6 +13020,11 @@ spec:
1299913020
be set.
1300013021
rule: 'self.type == ''Cookie'' ?
1300113022
has(self.cookie) : !has(self.cookie)'
13023+
- message: If consistent hash type
13024+
is queryParam, the queryParam
13025+
field must be set.
13026+
rule: 'self.type == ''QueryParam''
13027+
? has(self.queryParam) : !has(self.queryParam)'
1300213028
endpointOverride:
1300313029
description: |-
1300413030
EndpointOverride defines the configuration for endpoint override.
@@ -14257,6 +14283,11 @@ spec:
1425714283
- name
1425814284
type: object
1425914285
type: array
14286+
queryParam:
14287+
description: QueryParam configures the
14288+
query parameter hash policy when the
14289+
consistent hash type is set to QueryParam.
14290+
type: string
1426014291
tableSize:
1426114292
default: 65537
1426214293
description: The table size for consistent
@@ -14273,11 +14304,13 @@ spec:
1427314304
"Header",
1427414305
"Headers",
1427514306
"Cookie".
14307+
"QueryParam".
1427614308
enum:
1427714309
- SourceIP
1427814310
- Header
1427914311
- Headers
1428014312
- Cookie
14313+
- QueryParam
1428114314
type: string
1428214315
required:
1428314316
- type
@@ -14295,6 +14328,10 @@ spec:
1429514328
the cookie field must be set.
1429614329
rule: 'self.type == ''Cookie'' ? has(self.cookie)
1429714330
: !has(self.cookie)'
14331+
- message: If consistent hash type is queryParam,
14332+
the queryParam field must be set.
14333+
rule: 'self.type == ''QueryParam'' ? has(self.queryParam)
14334+
: !has(self.queryParam)'
1429814335
endpointOverride:
1429914336
description: |-
1430014337
EndpointOverride defines the configuration for endpoint override.
@@ -15462,6 +15499,11 @@ spec:
1546215499
- name
1546315500
type: object
1546415501
type: array
15502+
queryParam:
15503+
description: QueryParam configures the query
15504+
parameter hash policy when the consistent
15505+
hash type is set to QueryParam.
15506+
type: string
1546515507
tableSize:
1546615508
default: 65537
1546715509
description: The table size for consistent
@@ -15478,11 +15520,13 @@ spec:
1547815520
"Header",
1547915521
"Headers",
1548015522
"Cookie".
15523+
"QueryParam".
1548115524
enum:
1548215525
- SourceIP
1548315526
- Header
1548415527
- Headers
1548515528
- Cookie
15529+
- QueryParam
1548615530
type: string
1548715531
required:
1548815532
- type
@@ -15500,6 +15544,10 @@ spec:
1550015544
the cookie field must be set.
1550115545
rule: 'self.type == ''Cookie'' ? has(self.cookie)
1550215546
: !has(self.cookie)'
15547+
- message: If consistent hash type is queryParam,
15548+
the queryParam field must be set.
15549+
rule: 'self.type == ''QueryParam'' ? has(self.queryParam)
15550+
: !has(self.queryParam)'
1550315551
endpointOverride:
1550415552
description: |-
1550515553
EndpointOverride defines the configuration for endpoint override.

0 commit comments

Comments
 (0)