kubeadm: remove the deprecated flag '--image-pull-timeout' for 'kubeadm upgrade apply' command

This commit is contained in:
SataQiu 2021-05-18 20:34:05 +08:00
parent 5c58620118
commit 15dcc83cec

View File

@ -18,7 +18,6 @@ package upgrade
import (
"fmt"
"time"
"github.com/pkg/errors"
"github.com/spf13/cobra"
@ -38,10 +37,6 @@ import (
utilsexec "k8s.io/utils/exec"
)
const (
defaultImagePullTimeout = 15 * time.Minute
)
// applyFlags holds the information about the flags that can be passed to apply
type applyFlags struct {
*applyPlanFlags
@ -51,7 +46,6 @@ type applyFlags struct {
dryRun bool
etcdUpgrade bool
renewCerts bool
imagePullTimeout time.Duration
patchesDir string
}
@ -63,10 +57,9 @@ func (f *applyFlags) sessionIsInteractive() bool {
// newCmdApply returns the cobra command for `kubeadm upgrade apply`
func newCmdApply(apf *applyPlanFlags) *cobra.Command {
flags := &applyFlags{
applyPlanFlags: apf,
imagePullTimeout: defaultImagePullTimeout,
etcdUpgrade: true,
renewCerts: true,
applyPlanFlags: apf,
etcdUpgrade: true,
renewCerts: true,
}
cmd := &cobra.Command{
@ -86,9 +79,6 @@ func newCmdApply(apf *applyPlanFlags) *cobra.Command {
cmd.Flags().BoolVar(&flags.dryRun, options.DryRun, flags.dryRun, "Do not change any state, just output what actions would be performed.")
cmd.Flags().BoolVar(&flags.etcdUpgrade, "etcd-upgrade", flags.etcdUpgrade, "Perform the upgrade of etcd.")
cmd.Flags().BoolVar(&flags.renewCerts, options.CertificateRenewal, flags.renewCerts, "Perform the renewal of certificates used by component changed during upgrades.")
cmd.Flags().DurationVar(&flags.imagePullTimeout, "image-pull-timeout", flags.imagePullTimeout, "The maximum amount of time to wait for the control plane pods to be downloaded.")
// TODO: The flag was deprecated in 1.19; remove the flag following a GA deprecation policy of 12 months or 2 releases (whichever is longer)
cmd.Flags().MarkDeprecated("image-pull-timeout", "This flag is deprecated and will be removed in a future version.")
options.AddPatchesFlag(cmd.Flags(), &flags.patchesDir)
return cmd