You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0f45ef1
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: api/v1alpha1/ratelimit_types.go
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,7 @@ type LocalRateLimit struct {
68
68
// +optional
69
69
// +kubebuilder:validation:MaxItems=16
70
70
// +kubebuilder:validation:XValidation:rule="self.all(r, !has(r.cost) || !has(r.cost.response))", message="response cost is not supported for Local Rate Limits"
71
+
// +kubebuilder:validation:XValidation:rule="self.all(r, !has(r.limit.fromMetadata))", message="limit fromMetadata is not supported for Local Rate Limits"
71
72
Rules []RateLimitRule`json:"rules"`
72
73
}
73
74
@@ -440,6 +441,32 @@ type RateLimitValue struct {
440
441
// +kubebuilder:validation:Format=uint32
441
442
Requestsuint32`json:"requests"`
442
443
UnitRateLimitUnit`json:"unit"`
444
+
// FromMetadata sources the limit value from per-request dynamic metadata.
445
+
// When the referenced metadata value is present, it overrides Requests/Unit for that
446
+
// request; otherwise Requests/Unit are used as the default.
447
+
//
448
+
// The referenced metadata value must be a struct containing an integer "requests_per_unit"
449
+
// property and a "unit" property with a value parseable to a RateLimitUnit. An upstream
450
+
// filter (e.g. ext_proc) is responsible for writing this struct into dynamic metadata.
0 commit comments