mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
kubeadm: remove the deprecated flag '--image-pull-timeout' for 'kubeadm upgrade apply' command
This commit is contained in:
parent
5c58620118
commit
15dcc83cec
@ -18,7 +18,6 @@ package upgrade
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
@ -38,10 +37,6 @@ import (
|
|||||||
utilsexec "k8s.io/utils/exec"
|
utilsexec "k8s.io/utils/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
defaultImagePullTimeout = 15 * time.Minute
|
|
||||||
)
|
|
||||||
|
|
||||||
// applyFlags holds the information about the flags that can be passed to apply
|
// applyFlags holds the information about the flags that can be passed to apply
|
||||||
type applyFlags struct {
|
type applyFlags struct {
|
||||||
*applyPlanFlags
|
*applyPlanFlags
|
||||||
@ -51,7 +46,6 @@ type applyFlags struct {
|
|||||||
dryRun bool
|
dryRun bool
|
||||||
etcdUpgrade bool
|
etcdUpgrade bool
|
||||||
renewCerts bool
|
renewCerts bool
|
||||||
imagePullTimeout time.Duration
|
|
||||||
patchesDir string
|
patchesDir string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,10 +57,9 @@ func (f *applyFlags) sessionIsInteractive() bool {
|
|||||||
// newCmdApply returns the cobra command for `kubeadm upgrade apply`
|
// newCmdApply returns the cobra command for `kubeadm upgrade apply`
|
||||||
func newCmdApply(apf *applyPlanFlags) *cobra.Command {
|
func newCmdApply(apf *applyPlanFlags) *cobra.Command {
|
||||||
flags := &applyFlags{
|
flags := &applyFlags{
|
||||||
applyPlanFlags: apf,
|
applyPlanFlags: apf,
|
||||||
imagePullTimeout: defaultImagePullTimeout,
|
etcdUpgrade: true,
|
||||||
etcdUpgrade: true,
|
renewCerts: true,
|
||||||
renewCerts: true,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
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.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.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().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)
|
options.AddPatchesFlag(cmd.Flags(), &flags.patchesDir)
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
|
Loading…
Reference in New Issue
Block a user