From 15dcc83cec534218b51eb0342d3c1225af5a84c8 Mon Sep 17 00:00:00 2001 From: SataQiu Date: Tue, 18 May 2021 20:34:05 +0800 Subject: [PATCH] kubeadm: remove the deprecated flag '--image-pull-timeout' for 'kubeadm upgrade apply' command --- cmd/kubeadm/app/cmd/upgrade/apply.go | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/cmd/kubeadm/app/cmd/upgrade/apply.go b/cmd/kubeadm/app/cmd/upgrade/apply.go index 01227beaef1..652d52194eb 100644 --- a/cmd/kubeadm/app/cmd/upgrade/apply.go +++ b/cmd/kubeadm/app/cmd/upgrade/apply.go @@ -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