Skip to content

Commit 5d5c7d3

Browse files
Aias00claude
authored andcommitted
test: sync helm CRD snapshots for RateLimitRule name field
Regenerate the gateway-crds-helm golden snapshots so they reflect the new optional RateLimitRule.name schema and its CEL validations (non-numeric name, unique names within global/local rule slices) added in api/v1alpha1/ratelimit_types.go. The charts CRD sources were already regenerated; only the test/helm/gateway-crds-helm/*.out.yaml snapshots were stale, causing gen-check (helm-template) to fail. Signed-off-by: liuhy <liuhongyu@apache.org> Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7f71d3d commit 5d5c7d3

3 files changed

Lines changed: 147 additions & 0 deletions

File tree

test/helm/gateway-crds-helm/all.out.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26464,6 +26464,26 @@ spec:
2646426464
- requests
2646526465
- unit
2646626466
type: object
26467+
name:
26468+
description: |-
26469+
Name is a user-facing name for this rule that can be used for debugging
26470+
and observability. When set, the rate limit key will include this name,
26471+
making it easier to identify in metrics and dashboards.
26472+
The name must be unique within a policy and should be a stable identifier
26473+
that won't change when the rule order changes.
26474+
26475+
When name is set, the rate limit key format becomes:
26476+
<policy-namespace>/<policy-name>/rule/<rule-name>
26477+
When name is not set, the format remains:
26478+
<policy-namespace>/<policy-name>/rule/<rule-index>
26479+
maxLength: 64
26480+
pattern: ^[a-zA-Z0-9._-]+$
26481+
type: string
26482+
x-kubernetes-validations:
26483+
- message: rate limit rule name must not be purely numeric
26484+
to avoid collision with auto-generated index-based
26485+
rule names
26486+
rule: '!self.matches(''^[0-9]+$'')'
2646726487
shadowMode:
2646826488
description: |-
2646926489
ShadowMode indicates whether this rate-limit rule runs in shadow mode.
@@ -26493,6 +26513,11 @@ spec:
2649326513
type: object
2649426514
maxItems: 256
2649526515
type: array
26516+
x-kubernetes-validations:
26517+
- message: rate limit rule names must be unique within the
26518+
global rules slice
26519+
rule: self.all(r, !has(r.name) || self.filter(r2, has(r2.name)
26520+
&& r2.name == r.name).size() == 1)
2649626521
required:
2649726522
- rules
2649826523
type: object
@@ -26875,6 +26900,26 @@ spec:
2687526900
- requests
2687626901
- unit
2687726902
type: object
26903+
name:
26904+
description: |-
26905+
Name is a user-facing name for this rule that can be used for debugging
26906+
and observability. When set, the rate limit key will include this name,
26907+
making it easier to identify in metrics and dashboards.
26908+
The name must be unique within a policy and should be a stable identifier
26909+
that won't change when the rule order changes.
26910+
26911+
When name is set, the rate limit key format becomes:
26912+
<policy-namespace>/<policy-name>/rule/<rule-name>
26913+
When name is not set, the format remains:
26914+
<policy-namespace>/<policy-name>/rule/<rule-index>
26915+
maxLength: 64
26916+
pattern: ^[a-zA-Z0-9._-]+$
26917+
type: string
26918+
x-kubernetes-validations:
26919+
- message: rate limit rule name must not be purely numeric
26920+
to avoid collision with auto-generated index-based
26921+
rule names
26922+
rule: '!self.matches(''^[0-9]+$'')'
2687826923
shadowMode:
2687926924
description: |-
2688026925
ShadowMode indicates whether this rate-limit rule runs in shadow mode.
@@ -26910,6 +26955,10 @@ spec:
2691026955
- message: limit fromMetadata is not supported for Local Rate
2691126956
Limits
2691226957
rule: self.all(r, !has(r.limit.fromMetadata))
26958+
- message: rate limit rule names must be unique within the
26959+
local rules slice
26960+
rule: self.all(r, !has(r.name) || self.filter(r2, has(r2.name)
26961+
&& r2.name == r.name).size() == 1)
2691326962
type: object
2691426963
type:
2691526964
description: |-

test/helm/gateway-crds-helm/e2e.out.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,6 +2402,26 @@ spec:
24022402
- requests
24032403
- unit
24042404
type: object
2405+
name:
2406+
description: |-
2407+
Name is a user-facing name for this rule that can be used for debugging
2408+
and observability. When set, the rate limit key will include this name,
2409+
making it easier to identify in metrics and dashboards.
2410+
The name must be unique within a policy and should be a stable identifier
2411+
that won't change when the rule order changes.
2412+
2413+
When name is set, the rate limit key format becomes:
2414+
<policy-namespace>/<policy-name>/rule/<rule-name>
2415+
When name is not set, the format remains:
2416+
<policy-namespace>/<policy-name>/rule/<rule-index>
2417+
maxLength: 64
2418+
pattern: ^[a-zA-Z0-9._-]+$
2419+
type: string
2420+
x-kubernetes-validations:
2421+
- message: rate limit rule name must not be purely numeric
2422+
to avoid collision with auto-generated index-based
2423+
rule names
2424+
rule: '!self.matches(''^[0-9]+$'')'
24052425
shadowMode:
24062426
description: |-
24072427
ShadowMode indicates whether this rate-limit rule runs in shadow mode.
@@ -2431,6 +2451,11 @@ spec:
24312451
type: object
24322452
maxItems: 256
24332453
type: array
2454+
x-kubernetes-validations:
2455+
- message: rate limit rule names must be unique within the
2456+
global rules slice
2457+
rule: self.all(r, !has(r.name) || self.filter(r2, has(r2.name)
2458+
&& r2.name == r.name).size() == 1)
24342459
required:
24352460
- rules
24362461
type: object
@@ -2813,6 +2838,26 @@ spec:
28132838
- requests
28142839
- unit
28152840
type: object
2841+
name:
2842+
description: |-
2843+
Name is a user-facing name for this rule that can be used for debugging
2844+
and observability. When set, the rate limit key will include this name,
2845+
making it easier to identify in metrics and dashboards.
2846+
The name must be unique within a policy and should be a stable identifier
2847+
that won't change when the rule order changes.
2848+
2849+
When name is set, the rate limit key format becomes:
2850+
<policy-namespace>/<policy-name>/rule/<rule-name>
2851+
When name is not set, the format remains:
2852+
<policy-namespace>/<policy-name>/rule/<rule-index>
2853+
maxLength: 64
2854+
pattern: ^[a-zA-Z0-9._-]+$
2855+
type: string
2856+
x-kubernetes-validations:
2857+
- message: rate limit rule name must not be purely numeric
2858+
to avoid collision with auto-generated index-based
2859+
rule names
2860+
rule: '!self.matches(''^[0-9]+$'')'
28162861
shadowMode:
28172862
description: |-
28182863
ShadowMode indicates whether this rate-limit rule runs in shadow mode.
@@ -2848,6 +2893,10 @@ spec:
28482893
- message: limit fromMetadata is not supported for Local Rate
28492894
Limits
28502895
rule: self.all(r, !has(r.limit.fromMetadata))
2896+
- message: rate limit rule names must be unique within the
2897+
local rules slice
2898+
rule: self.all(r, !has(r.name) || self.filter(r2, has(r2.name)
2899+
&& r2.name == r.name).size() == 1)
28512900
type: object
28522901
type:
28532902
description: |-

test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,6 +2402,26 @@ spec:
24022402
- requests
24032403
- unit
24042404
type: object
2405+
name:
2406+
description: |-
2407+
Name is a user-facing name for this rule that can be used for debugging
2408+
and observability. When set, the rate limit key will include this name,
2409+
making it easier to identify in metrics and dashboards.
2410+
The name must be unique within a policy and should be a stable identifier
2411+
that won't change when the rule order changes.
2412+
2413+
When name is set, the rate limit key format becomes:
2414+
<policy-namespace>/<policy-name>/rule/<rule-name>
2415+
When name is not set, the format remains:
2416+
<policy-namespace>/<policy-name>/rule/<rule-index>
2417+
maxLength: 64
2418+
pattern: ^[a-zA-Z0-9._-]+$
2419+
type: string
2420+
x-kubernetes-validations:
2421+
- message: rate limit rule name must not be purely numeric
2422+
to avoid collision with auto-generated index-based
2423+
rule names
2424+
rule: '!self.matches(''^[0-9]+$'')'
24052425
shadowMode:
24062426
description: |-
24072427
ShadowMode indicates whether this rate-limit rule runs in shadow mode.
@@ -2431,6 +2451,11 @@ spec:
24312451
type: object
24322452
maxItems: 256
24332453
type: array
2454+
x-kubernetes-validations:
2455+
- message: rate limit rule names must be unique within the
2456+
global rules slice
2457+
rule: self.all(r, !has(r.name) || self.filter(r2, has(r2.name)
2458+
&& r2.name == r.name).size() == 1)
24342459
required:
24352460
- rules
24362461
type: object
@@ -2813,6 +2838,26 @@ spec:
28132838
- requests
28142839
- unit
28152840
type: object
2841+
name:
2842+
description: |-
2843+
Name is a user-facing name for this rule that can be used for debugging
2844+
and observability. When set, the rate limit key will include this name,
2845+
making it easier to identify in metrics and dashboards.
2846+
The name must be unique within a policy and should be a stable identifier
2847+
that won't change when the rule order changes.
2848+
2849+
When name is set, the rate limit key format becomes:
2850+
<policy-namespace>/<policy-name>/rule/<rule-name>
2851+
When name is not set, the format remains:
2852+
<policy-namespace>/<policy-name>/rule/<rule-index>
2853+
maxLength: 64
2854+
pattern: ^[a-zA-Z0-9._-]+$
2855+
type: string
2856+
x-kubernetes-validations:
2857+
- message: rate limit rule name must not be purely numeric
2858+
to avoid collision with auto-generated index-based
2859+
rule names
2860+
rule: '!self.matches(''^[0-9]+$'')'
28162861
shadowMode:
28172862
description: |-
28182863
ShadowMode indicates whether this rate-limit rule runs in shadow mode.
@@ -2848,6 +2893,10 @@ spec:
28482893
- message: limit fromMetadata is not supported for Local Rate
28492894
Limits
28502895
rule: self.all(r, !has(r.limit.fromMetadata))
2896+
- message: rate limit rule names must be unique within the
2897+
local rules slice
2898+
rule: self.all(r, !has(r.name) || self.filter(r2, has(r2.name)
2899+
&& r2.name == r.name).size() == 1)
28512900
type: object
28522901
type:
28532902
description: |-

0 commit comments

Comments
 (0)