Skip to content

Commit 4940e42

Browse files
committed
Fixed listType annotations for API Priority and Fairness
We were occasionally seeing ``` [SHOULD NOT HAPPEN] failed to create typed new object: .spec.rules: element 0: associative list without keys has an element that's a map type ``` So I changed all the listType annotations to `atomic` except when the element type is a scalar, which is the only case supported right now.
1 parent dba8d60 commit 4940e42

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

api/openapi-spec/swagger.json

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

staging/src/k8s.io/api/flowcontrol/v1alpha1/generated.proto

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

staging/src/k8s.io/api/flowcontrol/v1alpha1/types.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ type FlowSchemaList struct {
8484
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
8585

8686
// `items` is a list of FlowSchemas.
87-
// +listType=set
87+
// +listType=atomic
8888
Items []FlowSchema `json:"items" protobuf:"bytes,2,rep,name=items"`
8989
}
9090

@@ -107,7 +107,7 @@ type FlowSchemaSpec struct {
107107
// `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if
108108
// at least one member of rules matches the request.
109109
// if it is an empty slice, there will be no requests matching the FlowSchema.
110-
// +listType=set
110+
// +listType=atomic
111111
// +optional
112112
Rules []PolicyRulesWithSubjects `json:"rules,omitempty" protobuf:"bytes,4,rep,name=rules"`
113113
}
@@ -152,18 +152,18 @@ type PolicyRulesWithSubjects struct {
152152
// subjects is the list of normal user, serviceaccount, or group that this rule cares about.
153153
// There must be at least one member in this slice.
154154
// A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request.
155-
// +listType=set
155+
// +listType=atomic
156156
// Required.
157157
Subjects []Subject `json:"subjects" protobuf:"bytes,1,rep,name=subjects"`
158158
// `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the
159159
// target resource.
160160
// At least one of `resourceRules` and `nonResourceRules` has to be non-empty.
161-
// +listType=set
161+
// +listType=atomic
162162
// +optional
163163
ResourceRules []ResourcePolicyRule `json:"resourceRules,omitempty" protobuf:"bytes,2,opt,name=resourceRules"`
164164
// `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb
165165
// and the target non-resource URL.
166-
// +listType=set
166+
// +listType=atomic
167167
// +optional
168168
NonResourceRules []NonResourcePolicyRule `json:"nonResourceRules,omitempty" protobuf:"bytes,3,opt,name=nonResourceRules"`
169169
}
@@ -350,7 +350,7 @@ type PriorityLevelConfigurationList struct {
350350
// +optional
351351
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
352352
// `items` is a list of request-priorities.
353-
// +listType=set
353+
// +listType=atomic
354354
Items []PriorityLevelConfiguration `json:"items" protobuf:"bytes,2,rep,name=items"`
355355
}
356356

0 commit comments

Comments
 (0)