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
// RateLimitPolicySpec defines the desired state of RateLimitPolicy
122
122
// +kubebuilder:validation:XValidation:rule="self.targetRef.kind != 'Gateway' || !has(self.limits) || !self.limits.exists(x, has(self.limits[x].routeSelectors))",message="route selectors not supported when targeting a Gateway"
123
+
// +kubebuilder:validation:XValidation:rule="!(has(self.defaults.limits) && has(self.limits))",message="Implicit and explicit defaults are mutually exclusive"
123
124
typeRateLimitPolicySpecstruct {
124
125
// TargetRef identifies an API object to apply policy to.
125
126
// +kubebuilder:validation:XValidation:rule="self.group == 'gateway.networking.k8s.io'",message="Invalid targetRef.group. The only supported value is 'gateway.networking.k8s.io'"
@@ -128,7 +129,7 @@ type RateLimitPolicySpec struct {
128
129
129
130
// Defaults define explicit default values for this policy and for policies inheriting this policy
130
131
// +optional
131
-
DefaultsCommonSpec`json:"defaults"`
132
+
DefaultsCommonSpec`json:"defaults,omitempty"`
132
133
133
134
// Implicit default
134
135
CommonSpec`json:""`
@@ -142,11 +143,6 @@ type CommonSpec struct {
142
143
Limitsmap[string]Limit`json:"limits,omitempty"`
143
144
}
144
145
145
-
// IsUsed determines if any fields within CommonSpec is used
146
-
func (cCommonSpec) IsUsed() bool {
147
-
returnc.Limits!=nil
148
-
}
149
-
150
146
// RateLimitPolicyStatus defines the observed state of RateLimitPolicy
151
147
typeRateLimitPolicyStatusstruct {
152
148
// ObservedGeneration reflects the generation of the most recently observed spec.
0 commit comments