mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
Merge pull request #127123 from neolit123/1.32-remove-deprecated-upgrade-flags
kubeadm: remove deprecated upgrade flags for 1.32
This commit is contained in:
commit
d62b797c16
@ -610,8 +610,6 @@ func isAllowedFlag(flagName string) bool {
|
|||||||
kubeadmcmdoptions.KubeconfigDir,
|
kubeadmcmdoptions.KubeconfigDir,
|
||||||
kubeadmcmdoptions.UploadCerts,
|
kubeadmcmdoptions.UploadCerts,
|
||||||
kubeadmcmdoptions.PrintManifest,
|
kubeadmcmdoptions.PrintManifest,
|
||||||
kubeadmcmdoptions.FeatureGatesString, // TODO: remove this line when --feature-gates flag is deprecated and dropped from "kubeadm upgrade apply/plan"
|
|
||||||
"api-server-manifest", "controller-manager-manifest", "scheduler-manifest", // TODO: remove this line when these flags are deprecated and dropped from "kubeadm upgrade diff"
|
|
||||||
"allow-missing-template-keys", "output", "show-managed-fields",
|
"allow-missing-template-keys", "output", "show-managed-fields",
|
||||||
"print-join-command", "rootfs", "v", "log-file", "yes")
|
"print-join-command", "rootfs", "v", "log-file", "yes")
|
||||||
if allowedFlags.Has(flagName) {
|
if allowedFlags.Has(flagName) {
|
||||||
|
@ -54,12 +54,6 @@ type diffFlags struct {
|
|||||||
out io.Writer
|
out io.Writer
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
|
||||||
defaultAPIServerManifestPath = constants.GetStaticPodFilepath(constants.KubeAPIServer, constants.GetStaticPodDirectory())
|
|
||||||
defaultControllerManagerManifestPath = constants.GetStaticPodFilepath(constants.KubeControllerManager, constants.GetStaticPodDirectory())
|
|
||||||
defaultSchedulerManifestPath = constants.GetStaticPodFilepath(constants.KubeScheduler, constants.GetStaticPodDirectory())
|
|
||||||
)
|
|
||||||
|
|
||||||
// newCmdDiff returns the cobra command for `kubeadm upgrade diff`
|
// newCmdDiff returns the cobra command for `kubeadm upgrade diff`
|
||||||
func newCmdDiff(out io.Writer) *cobra.Command {
|
func newCmdDiff(out io.Writer) *cobra.Command {
|
||||||
flags := &diffFlags{
|
flags := &diffFlags{
|
||||||
@ -88,14 +82,7 @@ func newCmdDiff(out io.Writer) *cobra.Command {
|
|||||||
|
|
||||||
options.AddKubeConfigFlag(cmd.Flags(), &flags.kubeConfigPath)
|
options.AddKubeConfigFlag(cmd.Flags(), &flags.kubeConfigPath)
|
||||||
options.AddConfigFlag(cmd.Flags(), &flags.cfgPath)
|
options.AddConfigFlag(cmd.Flags(), &flags.cfgPath)
|
||||||
cmd.Flags().StringVar(&flags.apiServerManifestPath, "api-server-manifest", defaultAPIServerManifestPath, "path to API server manifest")
|
|
||||||
cmd.Flags().MarkDeprecated("api-server-manifest", "This flag is deprecated and will be removed in a future release.")
|
|
||||||
cmd.Flags().StringVar(&flags.controllerManagerManifestPath, "controller-manager-manifest", defaultControllerManagerManifestPath, "path to controller manifest")
|
|
||||||
cmd.Flags().MarkDeprecated("controller-manager-manifest", "This flag is deprecated and will be removed in a future release.")
|
|
||||||
cmd.Flags().StringVar(&flags.schedulerManifestPath, "scheduler-manifest", defaultSchedulerManifestPath, "path to scheduler manifest")
|
|
||||||
cmd.Flags().MarkDeprecated("scheduler-manifest", "This flag is deprecated and will be removed in a future release.")
|
|
||||||
cmd.Flags().IntVarP(&flags.contextLines, "context-lines", "c", 3, "How many lines of context in the diff")
|
cmd.Flags().IntVarP(&flags.contextLines, "context-lines", "c", 3, "How many lines of context in the diff")
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,13 +17,11 @@ limitations under the License.
|
|||||||
package upgrade
|
package upgrade
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/options"
|
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/options"
|
||||||
cmdutil "k8s.io/kubernetes/cmd/kubeadm/app/cmd/util"
|
cmdutil "k8s.io/kubernetes/cmd/kubeadm/app/cmd/util"
|
||||||
kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants"
|
kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants"
|
||||||
@ -73,8 +71,5 @@ func addApplyPlanFlags(fs *pflag.FlagSet, flags *applyPlanFlags) {
|
|||||||
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.")
|
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.")
|
||||||
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.")
|
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.")
|
||||||
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.")
|
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.")
|
||||||
options.AddFeatureGatesStringFlag(fs, &flags.featureGatesString) // TODO: remove in 1.32
|
|
||||||
_ = 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. "+
|
|
||||||
"Please edit the 'featureGates' field of ClusterConfiguration which is defined in the %s/%s ConfigMap instead.", metav1.NamespaceSystem, kubeadmconstants.KubeadmConfigConfigMap))
|
|
||||||
options.AddIgnorePreflightErrorsFlag(fs, &flags.ignorePreflightErrors)
|
options.AddIgnorePreflightErrorsFlag(fs, &flags.ignorePreflightErrors)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user