From 54427770aa52bdbc675922c9bfbd67149dc06f7c Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Mon, 30 Jun 2025 15:00:16 +0200 Subject: [PATCH] Set minimum=1 on ObservedGeneration and KubeadmConfig APIEndpoint bindPort MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- api/addons/v1beta2/clusterresourceset_types.go | 1 + api/bootstrap/kubeadm/v1beta2/kubeadm_types.go | 1 + api/bootstrap/kubeadm/v1beta2/kubeadmconfig_types.go | 1 + .../kubeadm/v1beta2/kubeadm_control_plane_types.go | 1 + api/core/v1beta2/cluster_types.go | 1 + api/core/v1beta2/clusterclass_types.go | 1 + api/core/v1beta2/machine_types.go | 1 + api/core/v1beta2/machinedeployment_types.go | 1 + api/core/v1beta2/machinehealthcheck_types.go | 1 + api/core/v1beta2/machinepool_types.go | 1 + api/core/v1beta2/machineset_types.go | 1 + .../crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml | 3 +++ .../bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml | 2 ++ .../crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml | 1 + config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml | 1 + config/crd/bases/cluster.x-k8s.io_clusters.yaml | 1 + config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml | 1 + config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml | 1 + config/crd/bases/cluster.x-k8s.io_machinepools.yaml | 1 + config/crd/bases/cluster.x-k8s.io_machines.yaml | 1 + config/crd/bases/cluster.x-k8s.io_machinesets.yaml | 1 + .../controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml | 3 +++ ...rolplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml | 2 ++ 23 files changed, 29 insertions(+) diff --git a/api/addons/v1beta2/clusterresourceset_types.go b/api/addons/v1beta2/clusterresourceset_types.go index e097595c0458..43caa4dc5969 100644 --- a/api/addons/v1beta2/clusterresourceset_types.go +++ b/api/addons/v1beta2/clusterresourceset_types.go @@ -129,6 +129,7 @@ type ClusterResourceSetStatus struct { // observedGeneration reflects the generation of the most recently observed ClusterResourceSet. // +optional + // +kubebuilder:validation:Minimum=1 ObservedGeneration int64 `json:"observedGeneration,omitempty"` // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. diff --git a/api/bootstrap/kubeadm/v1beta2/kubeadm_types.go b/api/bootstrap/kubeadm/v1beta2/kubeadm_types.go index e735ac564a29..3ce6b5506f79 100644 --- a/api/bootstrap/kubeadm/v1beta2/kubeadm_types.go +++ b/api/bootstrap/kubeadm/v1beta2/kubeadm_types.go @@ -242,6 +242,7 @@ type APIEndpoint struct { // bindPort sets the secure port for the API Server to bind to. // Defaults to 6443. // +optional + // +kubebuilder:validation:Minimum=1 BindPort int32 `json:"bindPort,omitempty"` } diff --git a/api/bootstrap/kubeadm/v1beta2/kubeadmconfig_types.go b/api/bootstrap/kubeadm/v1beta2/kubeadmconfig_types.go index 42e4a200c216..79d347b08c0b 100644 --- a/api/bootstrap/kubeadm/v1beta2/kubeadmconfig_types.go +++ b/api/bootstrap/kubeadm/v1beta2/kubeadmconfig_types.go @@ -472,6 +472,7 @@ type KubeadmConfigStatus struct { // observedGeneration is the latest generation observed by the controller. // +optional + // +kubebuilder:validation:Minimum=1 ObservedGeneration int64 `json:"observedGeneration,omitempty"` // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. diff --git a/api/controlplane/kubeadm/v1beta2/kubeadm_control_plane_types.go b/api/controlplane/kubeadm/v1beta2/kubeadm_control_plane_types.go index 2739ec15cf1e..c265a31f59a1 100644 --- a/api/controlplane/kubeadm/v1beta2/kubeadm_control_plane_types.go +++ b/api/controlplane/kubeadm/v1beta2/kubeadm_control_plane_types.go @@ -675,6 +675,7 @@ type KubeadmControlPlaneStatus struct { // observedGeneration is the latest generation observed by the controller. // +optional + // +kubebuilder:validation:Minimum=1 ObservedGeneration int64 `json:"observedGeneration,omitempty"` // lastRemediation stores info about last remediation performed. diff --git a/api/core/v1beta2/cluster_types.go b/api/core/v1beta2/cluster_types.go index ff639e1244cd..583292ec9466 100644 --- a/api/core/v1beta2/cluster_types.go +++ b/api/core/v1beta2/cluster_types.go @@ -996,6 +996,7 @@ type ClusterStatus struct { // observedGeneration is the latest generation observed by the controller. // +optional + // +kubebuilder:validation:Minimum=1 ObservedGeneration int64 `json:"observedGeneration,omitempty"` // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. diff --git a/api/core/v1beta2/clusterclass_types.go b/api/core/v1beta2/clusterclass_types.go index d02e1444a2a2..6a316748a15e 100644 --- a/api/core/v1beta2/clusterclass_types.go +++ b/api/core/v1beta2/clusterclass_types.go @@ -1218,6 +1218,7 @@ type ClusterClassStatus struct { // observedGeneration is the latest generation observed by the controller. // +optional + // +kubebuilder:validation:Minimum=1 ObservedGeneration int64 `json:"observedGeneration,omitempty"` // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. diff --git a/api/core/v1beta2/machine_types.go b/api/core/v1beta2/machine_types.go index a6a816baf6ef..f24f07b2c448 100644 --- a/api/core/v1beta2/machine_types.go +++ b/api/core/v1beta2/machine_types.go @@ -544,6 +544,7 @@ type MachineStatus struct { // observedGeneration is the latest generation observed by the controller. // +optional + // +kubebuilder:validation:Minimum=1 ObservedGeneration int64 `json:"observedGeneration,omitempty"` // deletion contains information relating to removal of the Machine. diff --git a/api/core/v1beta2/machinedeployment_types.go b/api/core/v1beta2/machinedeployment_types.go index 5aecd24682d4..0b3a642cddbb 100644 --- a/api/core/v1beta2/machinedeployment_types.go +++ b/api/core/v1beta2/machinedeployment_types.go @@ -431,6 +431,7 @@ type MachineDeploymentStatus struct { // observedGeneration is the generation observed by the deployment controller. // +optional + // +kubebuilder:validation:Minimum=1 ObservedGeneration int64 `json:"observedGeneration,omitempty"` // selector is the same as the label selector but in the string format to avoid introspection diff --git a/api/core/v1beta2/machinehealthcheck_types.go b/api/core/v1beta2/machinehealthcheck_types.go index 78429a3d0f70..28223d692f1c 100644 --- a/api/core/v1beta2/machinehealthcheck_types.go +++ b/api/core/v1beta2/machinehealthcheck_types.go @@ -225,6 +225,7 @@ type MachineHealthCheckStatus struct { // observedGeneration is the latest generation observed by the controller. // +optional + // +kubebuilder:validation:Minimum=1 ObservedGeneration int64 `json:"observedGeneration,omitempty"` // targets shows the current list of machines the machine health check is watching diff --git a/api/core/v1beta2/machinepool_types.go b/api/core/v1beta2/machinepool_types.go index 0f16263bf194..bfbb801e9357 100644 --- a/api/core/v1beta2/machinepool_types.go +++ b/api/core/v1beta2/machinepool_types.go @@ -147,6 +147,7 @@ type MachinePoolStatus struct { // observedGeneration is the latest generation observed by the controller. // +optional + // +kubebuilder:validation:Minimum=1 ObservedGeneration int64 `json:"observedGeneration,omitempty"` // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. diff --git a/api/core/v1beta2/machineset_types.go b/api/core/v1beta2/machineset_types.go index 3e5bf0cf3df8..9c2f5ea87965 100644 --- a/api/core/v1beta2/machineset_types.go +++ b/api/core/v1beta2/machineset_types.go @@ -312,6 +312,7 @@ type MachineSetStatus struct { // observedGeneration reflects the generation of the most recently observed MachineSet. // +optional + // +kubebuilder:validation:Minimum=1 ObservedGeneration int64 `json:"observedGeneration,omitempty"` // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml index 1ae9689fafd5..2ad329c536ba 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -5323,6 +5323,7 @@ spec: bindPort sets the secure port for the API Server to bind to. Defaults to 6443. format: int32 + minimum: 1 type: integer type: object nodeRegistration: @@ -5562,6 +5563,7 @@ spec: bindPort sets the secure port for the API Server to bind to. Defaults to 6443. format: int32 + minimum: 1 type: integer type: object type: object @@ -6313,6 +6315,7 @@ spec: description: observedGeneration is the latest generation observed by the controller. format: int64 + minimum: 1 type: integer type: object type: object diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml index 943b639b976b..e23ac90e0b3e 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -5225,6 +5225,7 @@ spec: bindPort sets the secure port for the API Server to bind to. Defaults to 6443. format: int32 + minimum: 1 type: integer type: object nodeRegistration: @@ -5465,6 +5466,7 @@ spec: bindPort sets the secure port for the API Server to bind to. Defaults to 6443. format: int32 + minimum: 1 type: integer type: object type: object diff --git a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml index 12335aa0b2f9..9aa7462c8add 100644 --- a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml +++ b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml @@ -864,6 +864,7 @@ spec: description: observedGeneration reflects the generation of the most recently observed ClusterResourceSet. format: int64 + minimum: 1 type: integer type: object type: object diff --git a/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml b/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml index 0a2f9b3c9196..6afee84c4c05 100644 --- a/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml +++ b/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml @@ -4706,6 +4706,7 @@ spec: description: observedGeneration is the latest generation observed by the controller. format: int64 + minimum: 1 type: integer variables: description: variables is a list of ClusterClassStatusVariable that diff --git a/config/crd/bases/cluster.x-k8s.io_clusters.yaml b/config/crd/bases/cluster.x-k8s.io_clusters.yaml index 395cfb676f15..fa212155d3b2 100644 --- a/config/crd/bases/cluster.x-k8s.io_clusters.yaml +++ b/config/crd/bases/cluster.x-k8s.io_clusters.yaml @@ -3516,6 +3516,7 @@ spec: description: observedGeneration is the latest generation observed by the controller. format: int64 + minimum: 1 type: integer phase: description: phase represents the current phase of cluster actuation. diff --git a/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml b/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml index df36083603db..97a0f1048101 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml @@ -2503,6 +2503,7 @@ spec: description: observedGeneration is the generation observed by the deployment controller. format: int64 + minimum: 1 type: integer phase: description: phase represents the current phase of a MachineDeployment diff --git a/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml b/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml index 510d9668d490..87d4e7dd44d1 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml @@ -1357,6 +1357,7 @@ spec: description: observedGeneration is the latest generation observed by the controller. format: int64 + minimum: 1 type: integer remediationsAllowed: description: |- diff --git a/config/crd/bases/cluster.x-k8s.io_machinepools.yaml b/config/crd/bases/cluster.x-k8s.io_machinepools.yaml index 0a9ecf33f7fb..1d1e8d852055 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinepools.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinepools.yaml @@ -2186,6 +2186,7 @@ spec: description: observedGeneration is the latest generation observed by the controller. format: int64 + minimum: 1 type: integer phase: description: phase represents the current phase of cluster actuation. diff --git a/config/crd/bases/cluster.x-k8s.io_machines.yaml b/config/crd/bases/cluster.x-k8s.io_machines.yaml index 2fde66113e0b..35e6e49f6617 100644 --- a/config/crd/bases/cluster.x-k8s.io_machines.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machines.yaml @@ -2070,6 +2070,7 @@ spec: description: observedGeneration is the latest generation observed by the controller. format: int64 + minimum: 1 type: integer phase: description: phase represents the current phase of machine actuation. diff --git a/config/crd/bases/cluster.x-k8s.io_machinesets.yaml b/config/crd/bases/cluster.x-k8s.io_machinesets.yaml index d8023f0bb213..776510b0cea7 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinesets.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinesets.yaml @@ -2190,6 +2190,7 @@ spec: description: observedGeneration reflects the generation of the most recently observed MachineSet. format: int64 + minimum: 1 type: integer readyReplicas: description: readyReplicas is the number of ready replicas for this diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml index ac503e645ece..fdc883e7c932 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -6259,6 +6259,7 @@ spec: bindPort sets the secure port for the API Server to bind to. Defaults to 6443. format: int32 + minimum: 1 type: integer type: object nodeRegistration: @@ -6498,6 +6499,7 @@ spec: bindPort sets the secure port for the API Server to bind to. Defaults to 6443. format: int32 + minimum: 1 type: integer type: object type: object @@ -7598,6 +7600,7 @@ spec: description: observedGeneration is the latest generation observed by the controller. format: int64 + minimum: 1 type: integer readyReplicas: description: readyReplicas is the number of ready replicas for this diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml index 4864846140a6..e72c697e71ab 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -4661,6 +4661,7 @@ spec: bindPort sets the secure port for the API Server to bind to. Defaults to 6443. format: int32 + minimum: 1 type: integer type: object nodeRegistration: @@ -4902,6 +4903,7 @@ spec: bindPort sets the secure port for the API Server to bind to. Defaults to 6443. format: int32 + minimum: 1 type: integer type: object type: object