From 4af99cd6764b2dcc59eddb0cb8b0b1bcc7583263 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Fri, 31 May 2024 12:12:53 +0300 Subject: [PATCH] kubeadm: deprecate v1beta3 Mark v1beta3 as deprecated by showing a warning when used and write a note about it in the doc.go file. --- cmd/kubeadm/app/apis/kubeadm/v1beta3/doc.go | 6 +++--- cmd/kubeadm/app/util/config/common.go | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/kubeadm/app/apis/kubeadm/v1beta3/doc.go b/cmd/kubeadm/app/apis/kubeadm/v1beta3/doc.go index 65e84298a46..338f6d69e27 100644 --- a/cmd/kubeadm/app/apis/kubeadm/v1beta3/doc.go +++ b/cmd/kubeadm/app/apis/kubeadm/v1beta3/doc.go @@ -22,6 +22,9 @@ limitations under the License. // Package v1beta3 defines the v1beta3 version of the kubeadm configuration file format. // This version improves on the v1beta2 format by fixing some minor issues and adding a few new fields. // +// DEPRECATED: v1beta3 is deprecated in favor of v1beta4 and will be removed in a future release, 1.34 or later. +// Please migrate. +// // A list of changes since v1beta2: // - The deprecated "ClusterConfiguration.useHyperKubeImage" field has been removed. // Kubeadm no longer supports the hyperkube image. @@ -280,6 +283,3 @@ limitations under the License. // // - APIEndpoint, that represents the endpoint of the instance of the API server to be eventually deployed on this node. package v1beta3 // import "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3" - -//TODO: The BootstrapTokenString object should move out to either k8s.io/client-go or k8s.io/api in the future -//(probably as part of Bootstrap Tokens going GA). It should not be staged under the kubeadm API as it is now. diff --git a/cmd/kubeadm/app/util/config/common.go b/cmd/kubeadm/app/util/config/common.go index 9f666a921af..dd434036011 100644 --- a/cmd/kubeadm/app/util/config/common.go +++ b/cmd/kubeadm/app/util/config/common.go @@ -83,11 +83,13 @@ func validateSupportedVersion(gv schema.GroupVersion, allowDeprecated, allowExpe "kubeadm.k8s.io/v1beta2": "v1.22", } - // Experimental API versions are present here until released. + // Experimental API versions are present here until released. Can be used only if allowed. experimentalAPIVersions := map[string]string{} - // Deprecated API versions are supported by us, but can only be used for migration. - deprecatedAPIVersions := map[string]struct{}{} + // Deprecated API versions are supported until removed. They throw a warning. + deprecatedAPIVersions := map[string]struct{}{ + "kubeadm.k8s.io/v1beta3": {}, + } gvString := gv.String()