Skip to content

Commit d11927c

Browse files
committed
Add maxItems to all condition fields
Signed-off-by: Stefan Büringer buringerst@vmware.com
1 parent 9569cd6 commit d11927c

9 files changed

+16
-0
lines changed

config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml

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

config/crd/bases/cluster.x-k8s.io_machinepools.yaml

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

docs/proposals/20240916-improve-status-in-CAPI-resources.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ type MachineStatus struct {
291291
// +optional
292292
// +listType=map
293293
// +listMapKey=type
294+
// +kubebuilder:validation:MaxItems=32
294295
Conditions []metav1.Condition `json:"conditions,omitempty"`
295296

296297
// Other fields...
@@ -488,6 +489,7 @@ type MachineSetStatus struct {
488489
// +optional
489490
// +listType=map
490491
// +listMapKey=type
492+
// +kubebuilder:validation:MaxItems=32
491493
Conditions []metav1.Condition `json:"conditions,omitempty"`
492494

493495
// Other fields...
@@ -616,6 +618,7 @@ type MachineDeploymentStatus struct {
616618
// +optional
617619
// +listType=map
618620
// +listMapKey=type
621+
// +kubebuilder:validation:MaxItems=32
619622
Conditions []metav1.Condition `json:"conditions,omitempty"`
620623

621624
// Other fields...
@@ -730,6 +733,7 @@ type ClusterStatus struct {
730733
// +optional
731734
// +listType=map
732735
// +listMapKey=type
736+
// +kubebuilder:validation:MaxItems=32
733737
Conditions []metav1.Condition `json:"conditions,omitempty"`
734738

735739
// ControlPlane groups all the observations about Cluster's ControlPlane current state.
@@ -981,6 +985,7 @@ type KubeadmControlPlaneStatus struct {
981985
// +optional
982986
// +listType=map
983987
// +listMapKey=type
988+
// +kubebuilder:validation:MaxItems=32
984989
Conditions []metav1.Condition `json:"conditions,omitempty"`
985990

986991
// Other fields...
@@ -1100,6 +1105,7 @@ type MachinePoolStatus struct {
11001105
// +optional
11011106
// +listType=map
11021107
// +listMapKey=type
1108+
// +kubebuilder:validation:MaxItems=32
11031109
Conditions []metav1.Condition `json:"conditions,omitempty"`
11041110

11051111
// Other fields...

exp/addons/api/v1beta1/clusterresourceset_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ type ClusterResourceSetV1Beta2Status struct {
115115
// +optional
116116
// +listType=map
117117
// +listMapKey=type
118+
// +kubebuilder:validation:MaxItems=32
118119
Conditions []metav1.Condition `json:"conditions,omitempty"`
119120
}
120121

exp/api/v1beta1/machinepool_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ type MachinePoolV1Beta2Status struct {
137137
// +optional
138138
// +listType=map
139139
// +listMapKey=type
140+
// +kubebuilder:validation:MaxItems=32
140141
Conditions []metav1.Condition `json:"conditions,omitempty"`
141142

142143
// readyReplicas is the number of ready replicas for this MachinePool. A machine is considered ready when Machine's Ready condition is true.

internal/test/builder/crd/test.cluster.x-k8s.io_phase1obj.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ spec:
156156
- status
157157
- type
158158
type: object
159+
maxItems: 32
159160
type: array
160161
x-kubernetes-list-map-keys:
161162
- type

internal/test/builder/crd/test.cluster.x-k8s.io_phase2obj.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ spec:
105105
- status
106106
- type
107107
type: object
108+
maxItems: 32
108109
type: array
109110
x-kubernetes-list-map-keys:
110111
- type

internal/test/builder/crd/test.cluster.x-k8s.io_phase3obj.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ spec:
104104
- status
105105
- type
106106
type: object
107+
maxItems: 32
107108
type: array
108109
x-kubernetes-list-map-keys:
109110
- type

internal/test/builder/v1beta2_transition.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ type Phase1ObjStatusV1Beta2 struct {
138138
// +optional
139139
// +listType=map
140140
// +listMapKey=type
141+
// +kubebuilder:validation:MaxItems=32
141142
Conditions []metav1.Condition `json:"conditions,omitempty"`
142143
}
143144

@@ -201,6 +202,7 @@ type Phase2ObjStatus struct {
201202
// +optional
202203
// +listType=map
203204
// +listMapKey=type
205+
// +kubebuilder:validation:MaxItems=32
204206
Conditions []metav1.Condition `json:"conditions,omitempty"`
205207

206208
// +optional
@@ -284,6 +286,7 @@ type Phase3ObjStatus struct {
284286
// +optional
285287
// +listType=map
286288
// +listMapKey=type
289+
// +kubebuilder:validation:MaxItems=32
287290
Conditions []metav1.Condition `json:"conditions,omitempty"`
288291
}
289292

0 commit comments

Comments
 (0)