Skip to content

Commit 9c3b159

Browse files
committed
update codegen
Signed-off-by: Haywood Shannon <[email protected]> Signed-off-by: Haywood Shannon <[email protected]>
1 parent c4b77ac commit 9c3b159

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

internal/configs/virtualserver_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6522,8 +6522,8 @@ func TestGenerateVirtualServerConfigRateLimitPolicyAuthJwt(t *testing.T) {
65226522
},
65236523
HTTPSnippets: []string{},
65246524
LimitReqZones: []version2.LimitReqZone{
6525-
{"test", "pol_rl_default_gold-rate-limit-policy_default_cafe", "10M", "10r/s"},
6526-
{"test", "pol_rl_default_silver-rate-limit-policy_default_cafe", "20M", "20r/s"},
6525+
{Key: "test", ZoneName: "pol_rl_default_gold-rate-limit-policy_default_cafe", ZoneSize: "10M", Rate: "10r/s"},
6526+
{Key: "test", ZoneName: "pol_rl_default_silver-rate-limit-policy_default_cafe", ZoneSize: "20M", Rate: "20r/s"},
65276527
},
65286528
Server: version2.Server{
65296529
JWTAuthList: nil,
@@ -6542,8 +6542,8 @@ func TestGenerateVirtualServerConfigRateLimitPolicyAuthJwt(t *testing.T) {
65426542
VSName: "cafe",
65436543
APIKeyEnabled: false,
65446544
LimitReqs: []version2.LimitReq{
6545-
{"pol_rl_default_gold-rate-limit-policy_default_cafe", 0, false, 0},
6546-
{"pol_rl_default_silver-rate-limit-policy_default_cafe", 0, false, 0},
6545+
{ZoneName: "pol_rl_default_gold-rate-limit-policy_default_cafe", Burst: 0, NoDelay: false, Delay: 0},
6546+
{ZoneName: "pol_rl_default_silver-rate-limit-policy_default_cafe", Burst: 0, NoDelay: false, Delay: 0},
65476547
},
65486548
LimitReqOptions: version2.LimitReqOptions{
65496549
DryRun: false,

pkg/apis/configuration/v1/types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,12 +614,15 @@ type RateLimit struct {
614614
Condition *RateLimitCondition `json:"condition"`
615615
}
616616

617+
// RateLimitCondition defines a condition for a rate limit policy.
617618
type RateLimitCondition struct {
618619
JWT JWTCondition `json:"jwt"`
619620
// +kubebuilder:validation:Optional
620621
Default bool `json:"default"`
621622
}
622623

624+
// RateLimitCondition defines a condition for a rate limit by JWT claim.
625+
623626
type JWTCondition struct {
624627
// +kubebuilder:validation:Required
625628
// +kubebuilder:validation:Pattern=`^([^$\s"'])*$`

pkg/apis/configuration/v1/zz_generated.deepcopy.go

Lines changed: 38 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)