Skip to content

Commit 4bb8fd5

Browse files
authored
Merge pull request #11256 from sbueringer/pr-conditions-fixup
🌱 Add maxItems to all condition fields
2 parents 233ec90 + d11927c commit 4bb8fd5

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...
@@ -491,6 +492,7 @@ type MachineSetStatus struct {
491492
// +optional
492493
// +listType=map
493494
// +listMapKey=type
495+
// +kubebuilder:validation:MaxItems=32
494496
Conditions []metav1.Condition `json:"conditions,omitempty"`
495497

496498
// Other fields...
@@ -619,6 +621,7 @@ type MachineDeploymentStatus struct {
619621
// +optional
620622
// +listType=map
621623
// +listMapKey=type
624+
// +kubebuilder:validation:MaxItems=32
622625
Conditions []metav1.Condition `json:"conditions,omitempty"`
623626

624627
// Other fields...
@@ -733,6 +736,7 @@ type ClusterStatus struct {
733736
// +optional
734737
// +listType=map
735738
// +listMapKey=type
739+
// +kubebuilder:validation:MaxItems=32
736740
Conditions []metav1.Condition `json:"conditions,omitempty"`
737741

738742
// ControlPlane groups all the observations about Cluster's ControlPlane current state.
@@ -984,6 +988,7 @@ type KubeadmControlPlaneStatus struct {
984988
// +optional
985989
// +listType=map
986990
// +listMapKey=type
991+
// +kubebuilder:validation:MaxItems=32
987992
Conditions []metav1.Condition `json:"conditions,omitempty"`
988993

989994
// Other fields...
@@ -1103,6 +1108,7 @@ type MachinePoolStatus struct {
11031108
// +optional
11041109
// +listType=map
11051110
// +listMapKey=type
1111+
// +kubebuilder:validation:MaxItems=32
11061112
Conditions []metav1.Condition `json:"conditions,omitempty"`
11071113

11081114
// 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)