Skip to content

Commit eb08a0c

Browse files
authored
Merge pull request #12435 from sbueringer/pr-optionalfields-status
⚠️ Align Status fields to optionalfields API conventions
2 parents ff6f736 + a94ad9b commit eb08a0c

25 files changed

+39
-15
lines changed

api/addons/v1beta2/clusterresourceset_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ func (c *ClusterResourceSetSpec) SetTypedStrategy(p ClusterResourceSetStrategy)
118118
// ANCHOR: ClusterResourceSetStatus
119119

120120
// ClusterResourceSetStatus defines the observed state of ClusterResourceSet.
121+
// +kubebuilder:validation:MinProperties=1
121122
type ClusterResourceSetStatus struct {
122123
// conditions represents the observations of a ClusterResourceSet's current state.
123124
// Known condition types are ResourcesApplied.
@@ -207,7 +208,7 @@ type ClusterResourceSet struct {
207208
Spec ClusterResourceSetSpec `json:"spec,omitempty"`
208209
// status is the observed state of ClusterResourceSet.
209210
// +optional
210-
Status ClusterResourceSetStatus `json:"status,omitempty"`
211+
Status ClusterResourceSetStatus `json:"status,omitempty,omitzero"`
211212
}
212213

213214
// +kubebuilder:object:root=true

api/bootstrap/kubeadm/v1beta2/kubeadmconfig_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ type ContainerLinuxConfig struct {
450450
}
451451

452452
// KubeadmConfigStatus defines the observed state of KubeadmConfig.
453+
// +kubebuilder:validation:MinProperties=1
453454
type KubeadmConfigStatus struct {
454455
// conditions represents the observations of a KubeadmConfig's current state.
455456
// Known condition types are Ready, DataSecretAvailable, CertificatesAvailable.
@@ -545,7 +546,7 @@ type KubeadmConfig struct {
545546
Spec KubeadmConfigSpec `json:"spec,omitempty"`
546547
// status is the observed state of KubeadmConfig.
547548
// +optional
548-
Status KubeadmConfigStatus `json:"status,omitempty"`
549+
Status KubeadmConfigStatus `json:"status,omitempty,omitzero"`
549550
}
550551

551552
// GetV1Beta1Conditions returns the set of conditions for this object.

api/controlplane/kubeadm/v1beta2/kubeadm_control_plane_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ type MachineNamingStrategy struct {
624624
}
625625

626626
// KubeadmControlPlaneStatus defines the observed state of KubeadmControlPlane.
627+
// +kubebuilder:validation:MinProperties=1
627628
type KubeadmControlPlaneStatus struct {
628629
// conditions represents the observations of a KubeadmControlPlane's current state.
629630
// Known condition types are Available, CertificatesAvailable, EtcdClusterAvailable, MachinesReady, MachinesUpToDate,
@@ -810,7 +811,7 @@ type KubeadmControlPlane struct {
810811
Spec KubeadmControlPlaneSpec `json:"spec,omitempty"`
811812
// status is the observed state of KubeadmControlPlane.
812813
// +optional
813-
Status KubeadmControlPlaneStatus `json:"status,omitempty"`
814+
Status KubeadmControlPlaneStatus `json:"status,omitempty,omitzero"`
814815
}
815816

816817
// GetV1Beta1Conditions returns the set of conditions for this object.

api/core/v1beta2/cluster_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ func (n NetworkRanges) String() string {
957957
// ANCHOR: ClusterStatus
958958

959959
// ClusterStatus defines the observed state of Cluster.
960+
// +kubebuilder:validation:MinProperties=1
960961
type ClusterStatus struct {
961962
// conditions represents the observations of a Cluster's current state.
962963
// Known condition types are Available, InfrastructureReady, ControlPlaneInitialized, ControlPlaneAvailable, WorkersAvailable, MachinesReady
@@ -1188,7 +1189,7 @@ type Cluster struct {
11881189
Spec ClusterSpec `json:"spec,omitempty"`
11891190
// status is the observed state of Cluster.
11901191
// +optional
1191-
Status ClusterStatus `json:"status,omitempty"`
1192+
Status ClusterStatus `json:"status,omitempty,omitzero"`
11921193
}
11931194

11941195
// GetClassKey returns the namespaced name for the class associated with this object.

api/core/v1beta2/clusterclass_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ type ClusterClass struct {
8585
Spec ClusterClassSpec `json:"spec,omitempty"`
8686
// status is the observed state of ClusterClass.
8787
// +optional
88-
Status ClusterClassStatus `json:"status,omitempty"`
88+
Status ClusterClassStatus `json:"status,omitempty,omitzero"`
8989
}
9090

9191
// ClusterClassSpec describes the desired state of the ClusterClass.
@@ -1202,6 +1202,7 @@ func (r *ClusterClassTemplateReference) GroupVersionKind() schema.GroupVersionKi
12021202
// ANCHOR: ClusterClassStatus
12031203

12041204
// ClusterClassStatus defines the observed state of the ClusterClass.
1205+
// +kubebuilder:validation:MinProperties=1
12051206
type ClusterClassStatus struct {
12061207
// conditions represents the observations of a ClusterClass's current state.
12071208
// Known condition types are VariablesReady, RefVersionsUpToDate, Paused.

api/core/v1beta2/machine_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ type MachineReadinessGate struct {
496496
// ANCHOR: MachineStatus
497497

498498
// MachineStatus defines the observed state of Machine.
499+
// +kubebuilder:validation:MinProperties=1
499500
type MachineStatus struct {
500501
// conditions represents the observations of a Machine's current state.
501502
// Known condition types are Available, Ready, UpToDate, BootstrapConfigReady, InfrastructureReady, NodeReady,
@@ -739,7 +740,7 @@ type Machine struct {
739740
Spec MachineSpec `json:"spec,omitempty"`
740741
// status is the observed state of Machine.
741742
// +optional
742-
Status MachineStatus `json:"status,omitempty"`
743+
Status MachineStatus `json:"status,omitempty,omitzero"`
743744
}
744745

745746
// GetV1Beta1Conditions returns the set of conditions for this object.

api/core/v1beta2/machinedeployment_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ type MachineNamingStrategy struct {
419419
// ANCHOR: MachineDeploymentStatus
420420

421421
// MachineDeploymentStatus defines the observed state of MachineDeployment.
422+
// +kubebuilder:validation:MinProperties=1
422423
type MachineDeploymentStatus struct {
423424
// conditions represents the observations of a MachineDeployment's current state.
424425
// Known condition types are Available, MachinesReady, MachinesUpToDate, ScalingUp, ScalingDown, Remediating, Deleting, Paused.
@@ -596,7 +597,7 @@ type MachineDeployment struct {
596597
Spec MachineDeploymentSpec `json:"spec,omitempty"`
597598
// status is the observed state of MachineDeployment.
598599
// +optional
599-
Status MachineDeploymentStatus `json:"status,omitempty"`
600+
Status MachineDeploymentStatus `json:"status,omitempty,omitzero"`
600601
}
601602

602603
// +kubebuilder:object:root=true

api/core/v1beta2/machinehealthcheck_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ type UnhealthyNodeCondition struct {
198198
// ANCHOR: MachineHealthCheckStatus
199199

200200
// MachineHealthCheckStatus defines the observed state of MachineHealthCheck.
201+
// +kubebuilder:validation:MinProperties=1
201202
type MachineHealthCheckStatus struct {
202203
// conditions represents the observations of a MachineHealthCheck's current state.
203204
// Known condition types are RemediationAllowed, Paused.
@@ -285,7 +286,7 @@ type MachineHealthCheck struct {
285286

286287
// status is the most recently observed status of MachineHealthCheck resource
287288
// +optional
288-
Status MachineHealthCheckStatus `json:"status,omitempty"`
289+
Status MachineHealthCheckStatus `json:"status,omitempty,omitzero"`
289290
}
290291

291292
// GetV1Beta1Conditions returns the set of conditions for this object.

api/core/v1beta2/machinepool_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ type MachinePoolSpec struct {
104104
// ANCHOR: MachinePoolStatus
105105

106106
// MachinePoolStatus defines the observed state of MachinePool.
107+
// +kubebuilder:validation:MinProperties=1
107108
type MachinePoolStatus struct {
108109
// conditions represents the observations of a MachinePool's current state.
109110
// Known condition types are Available, BootstrapConfigReady, InfrastructureReady, MachinesReady, MachinesUpToDate,
@@ -347,7 +348,7 @@ type MachinePool struct {
347348
Spec MachinePoolSpec `json:"spec,omitempty"`
348349
// status is the observed state of MachinePool.
349350
// +optional
350-
Status MachinePoolStatus `json:"status,omitempty"`
351+
Status MachinePoolStatus `json:"status,omitempty,omitzero"`
351352
}
352353

353354
// GetV1Beta1Conditions returns the set of conditions for this object.

api/core/v1beta2/machineset_types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ const (
277277
// ANCHOR: MachineSetStatus
278278

279279
// MachineSetStatus defines the observed state of MachineSet.
280+
// +kubebuilder:validation:MinProperties=1
280281
type MachineSetStatus struct {
281282
// conditions represents the observations of a MachineSet's current state.
282283
// Known condition types are MachinesReady, MachinesUpToDate, ScalingUp, ScalingDown, Remediating, Deleting, Paused.
@@ -450,7 +451,7 @@ type MachineSet struct {
450451
Spec MachineSetSpec `json:"spec,omitempty"`
451452
// status is the observed state of MachineSet.
452453
// +optional
453-
Status MachineSetStatus `json:"status,omitempty"`
454+
Status MachineSetStatus `json:"status,omitempty,omitzero"`
454455
}
455456

456457
// GetV1Beta1Conditions returns the set of conditions for the MachineSet.

0 commit comments

Comments
 (0)