From daa711590770de75994d7d3b2870210cfae116c6 Mon Sep 17 00:00:00 2001 From: SataQiu Date: Thu, 1 Jun 2023 23:06:26 +0800 Subject: [PATCH] kubeadm: add deprecation message for UpgradeAddonsBeforeControlPlane feature gate --- cmd/kubeadm/app/features/features.go | 11 +++++++---- cmd/kubeadm/app/phases/upgrade/postupgrade.go | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/kubeadm/app/features/features.go b/cmd/kubeadm/app/features/features.go index a8878e1a426..ccbab037955 100644 --- a/cmd/kubeadm/app/features/features.go +++ b/cmd/kubeadm/app/features/features.go @@ -42,10 +42,13 @@ const ( // InitFeatureGates are the default feature gates for the init command var InitFeatureGates = FeatureList{ - PublicKeysECDSA: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}}, - RootlessControlPlane: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}}, - EtcdLearnerMode: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}}, - UpgradeAddonsBeforeControlPlane: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Deprecated}}, + PublicKeysECDSA: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}}, + RootlessControlPlane: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}}, + EtcdLearnerMode: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}}, + UpgradeAddonsBeforeControlPlane: { + FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Deprecated}, + DeprecationMessage: "The UpgradeAddonsBeforeControlPlane feature gate is deprecated and will be removed in a future release.", + }, } // Feature represents a feature being gated diff --git a/cmd/kubeadm/app/phases/upgrade/postupgrade.go b/cmd/kubeadm/app/phases/upgrade/postupgrade.go index 10191a9554c..c05c5f0c039 100644 --- a/cmd/kubeadm/app/phases/upgrade/postupgrade.go +++ b/cmd/kubeadm/app/phases/upgrade/postupgrade.go @@ -135,7 +135,7 @@ func PerformAddonsUpgrade(client clientset.Interface, cfg *kubeadmapi.InitConfig // when UpgradeAddonsBeforeControlPlane feature gate is enabled, just throw a warning klog.V(1).Infof("upgrading addons when control plane instances %v have not been upgraded "+ - "may lead to incompatibility problems. You can disable the UpgradeAddonsBeforeControlPlane feature gate to"+ + "may lead to incompatibility problems. You can disable the UpgradeAddonsBeforeControlPlane feature gate to "+ "ensure that the addons upgrade is executed only when all the control plane instances have been upgraded.", unupgradedControlPlanes) }