Skip to content

Commit d62b797

Browse files
authored
Merge pull request kubernetes#127123 from neolit123/1.32-remove-deprecated-upgrade-flags
kubeadm: remove deprecated upgrade flags for 1.32
2 parents ebe3404 + 730fd13 commit d62b797

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

cmd/kubeadm/app/apis/kubeadm/validation/validation.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,6 @@ func isAllowedFlag(flagName string) bool {
610610
kubeadmcmdoptions.KubeconfigDir,
611611
kubeadmcmdoptions.UploadCerts,
612612
kubeadmcmdoptions.PrintManifest,
613-
kubeadmcmdoptions.FeatureGatesString, // TODO: remove this line when --feature-gates flag is deprecated and dropped from "kubeadm upgrade apply/plan"
614-
"api-server-manifest", "controller-manager-manifest", "scheduler-manifest", // TODO: remove this line when these flags are deprecated and dropped from "kubeadm upgrade diff"
615613
"allow-missing-template-keys", "output", "show-managed-fields",
616614
"print-join-command", "rootfs", "v", "log-file", "yes")
617615
if allowedFlags.Has(flagName) {

cmd/kubeadm/app/cmd/upgrade/diff.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ type diffFlags struct {
5454
out io.Writer
5555
}
5656

57-
var (
58-
defaultAPIServerManifestPath = constants.GetStaticPodFilepath(constants.KubeAPIServer, constants.GetStaticPodDirectory())
59-
defaultControllerManagerManifestPath = constants.GetStaticPodFilepath(constants.KubeControllerManager, constants.GetStaticPodDirectory())
60-
defaultSchedulerManifestPath = constants.GetStaticPodFilepath(constants.KubeScheduler, constants.GetStaticPodDirectory())
61-
)
62-
6357
// newCmdDiff returns the cobra command for `kubeadm upgrade diff`
6458
func newCmdDiff(out io.Writer) *cobra.Command {
6559
flags := &diffFlags{
@@ -88,14 +82,7 @@ func newCmdDiff(out io.Writer) *cobra.Command {
8882

8983
options.AddKubeConfigFlag(cmd.Flags(), &flags.kubeConfigPath)
9084
options.AddConfigFlag(cmd.Flags(), &flags.cfgPath)
91-
cmd.Flags().StringVar(&flags.apiServerManifestPath, "api-server-manifest", defaultAPIServerManifestPath, "path to API server manifest")
92-
cmd.Flags().MarkDeprecated("api-server-manifest", "This flag is deprecated and will be removed in a future release.")
93-
cmd.Flags().StringVar(&flags.controllerManagerManifestPath, "controller-manager-manifest", defaultControllerManagerManifestPath, "path to controller manifest")
94-
cmd.Flags().MarkDeprecated("controller-manager-manifest", "This flag is deprecated and will be removed in a future release.")
95-
cmd.Flags().StringVar(&flags.schedulerManifestPath, "scheduler-manifest", defaultSchedulerManifestPath, "path to scheduler manifest")
96-
cmd.Flags().MarkDeprecated("scheduler-manifest", "This flag is deprecated and will be removed in a future release.")
9785
cmd.Flags().IntVarP(&flags.contextLines, "context-lines", "c", 3, "How many lines of context in the diff")
98-
9986
return cmd
10087
}
10188

cmd/kubeadm/app/cmd/upgrade/upgrade.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ limitations under the License.
1717
package upgrade
1818

1919
import (
20-
"fmt"
2120
"io"
2221

2322
"github.com/spf13/cobra"
2423
"github.com/spf13/pflag"
2524

26-
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2725
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/options"
2826
cmdutil "k8s.io/kubernetes/cmd/kubeadm/app/cmd/util"
2927
kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants"
@@ -73,8 +71,5 @@ func addApplyPlanFlags(fs *pflag.FlagSet, flags *applyPlanFlags) {
7371
fs.BoolVar(&flags.allowExperimentalUpgrades, "allow-experimental-upgrades", flags.allowExperimentalUpgrades, "Show unstable versions of Kubernetes as an upgrade alternative and allow upgrading to an alpha/beta/release candidate versions of Kubernetes.")
7472
fs.BoolVar(&flags.allowRCUpgrades, "allow-release-candidate-upgrades", flags.allowRCUpgrades, "Show release candidate versions of Kubernetes as an upgrade alternative and allow upgrading to a release candidate versions of Kubernetes.")
7573
fs.BoolVar(&flags.printConfig, "print-config", flags.printConfig, "Specifies whether the configuration file that will be used in the upgrade should be printed or not.")
76-
options.AddFeatureGatesStringFlag(fs, &flags.featureGatesString) // TODO: remove in 1.32
77-
_ = fs.MarkDeprecated(options.FeatureGatesString, fmt.Sprintf("This flag is deprecated and no-op now. It will be removed in a future release. The upgrade workflow is not designed to reconfigure the cluster. "+
78-
"Please edit the 'featureGates' field of ClusterConfiguration which is defined in the %s/%s ConfigMap instead.", metav1.NamespaceSystem, kubeadmconstants.KubeadmConfigConfigMap))
7974
options.AddIgnorePreflightErrorsFlag(fs, &flags.ignorePreflightErrors)
8075
}

0 commit comments

Comments
 (0)