From d42875c30cd95131a43cf54e84b55baccb6c8be0 Mon Sep 17 00:00:00 2001 From: Amulyam24 Date: Thu, 17 Apr 2025 12:20:04 +0530 Subject: [PATCH] Make joinConfiguration.discovery.bootstrapToken.token optional --- bootstrap/kubeadm/api/v1beta1/kubeadm_types.go | 4 ++-- bootstrap/kubeadm/api/v1beta2/kubeadm_types.go | 4 ++-- .../crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml | 4 ---- .../bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml | 4 ---- .../controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml | 4 ---- ...olplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml | 4 ---- 6 files changed, 4 insertions(+), 20 deletions(-) diff --git a/bootstrap/kubeadm/api/v1beta1/kubeadm_types.go b/bootstrap/kubeadm/api/v1beta1/kubeadm_types.go index 7b732193d1b3..97f7dafca20c 100644 --- a/bootstrap/kubeadm/api/v1beta1/kubeadm_types.go +++ b/bootstrap/kubeadm/api/v1beta1/kubeadm_types.go @@ -584,10 +584,10 @@ type Discovery struct { type BootstrapTokenDiscovery struct { // token is a token used to validate cluster information // fetched from the control-plane. - // +required + // +optional // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=512 - Token string `json:"token"` + Token string `json:"token,omitempty"` // apiServerEndpoint is an IP or domain name to the API server from which info will be fetched. // +optional diff --git a/bootstrap/kubeadm/api/v1beta2/kubeadm_types.go b/bootstrap/kubeadm/api/v1beta2/kubeadm_types.go index e690beb93101..d5d217b01665 100644 --- a/bootstrap/kubeadm/api/v1beta2/kubeadm_types.go +++ b/bootstrap/kubeadm/api/v1beta2/kubeadm_types.go @@ -628,10 +628,10 @@ type Discovery struct { type BootstrapTokenDiscovery struct { // token is a token used to validate cluster information // fetched from the control-plane. - // +required + // +optional // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=512 - Token string `json:"token"` + Token string `json:"token,omitempty"` // apiServerEndpoint is an IP or domain name to the API server from which info will be fetched. // +optional 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 38c187de2668..bca9986d5061 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 @@ -3440,8 +3440,6 @@ spec: without CA verification via CACertHashes. This can weaken the security of kubeadm since other nodes can impersonate the control-plane. type: boolean - required: - - token type: object file: description: |- @@ -5520,8 +5518,6 @@ spec: without CA verification via CACertHashes. This can weaken the security of kubeadm since other nodes can impersonate the control-plane. type: boolean - required: - - token type: object file: description: |- 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 68bafa66a42c..f498512f5ae5 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 @@ -3423,8 +3423,6 @@ spec: without CA verification via CACertHashes. This can weaken the security of kubeadm since other nodes can impersonate the control-plane. type: boolean - required: - - token type: object file: description: |- @@ -5424,8 +5422,6 @@ spec: without CA verification via CACertHashes. This can weaken the security of kubeadm since other nodes can impersonate the control-plane. type: boolean - required: - - token type: object file: description: |- 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 52a4d3fc2aba..f6d5a38c9ccc 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 @@ -3926,8 +3926,6 @@ spec: without CA verification via CACertHashes. This can weaken the security of kubeadm since other nodes can impersonate the control-plane. type: boolean - required: - - token type: object file: description: |- @@ -6457,8 +6455,6 @@ spec: without CA verification via CACertHashes. This can weaken the security of kubeadm since other nodes can impersonate the control-plane. type: boolean - required: - - token type: object file: description: |- 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 1d3d6b4b1172..8bb0970bfa22 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 @@ -2649,8 +2649,6 @@ spec: without CA verification via CACertHashes. This can weaken the security of kubeadm since other nodes can impersonate the control-plane. type: boolean - required: - - token type: object file: description: |- @@ -4854,8 +4852,6 @@ spec: without CA verification via CACertHashes. This can weaken the security of kubeadm since other nodes can impersonate the control-plane. type: boolean - required: - - token type: object file: description: |-