mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #87975 from SataQiu/kubeadm-20200210
kubeadm: remove 'kubeadm upgrade node config' command when v1.18 is released
This commit is contained in:
commit
df908c3aad
@ -93,10 +93,6 @@ func NewCmdNode() *cobra.Command {
|
||||
// command help, adding --skip-phases flag and by adding phases subcommands
|
||||
nodeRunner.BindToCommand(cmd)
|
||||
|
||||
// upgrade node config command is subject to GA deprecation policy, so we should deprecate it
|
||||
// and keep it here for one year or three releases - the longer of the two - starting from v1.15 included
|
||||
cmd.AddCommand(NewCmdUpgradeNodeConfig())
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
@ -195,41 +191,3 @@ func (d *nodeData) Client() clientset.Interface {
|
||||
func (d *nodeData) KustomizeDir() string {
|
||||
return d.kustomizeDir
|
||||
}
|
||||
|
||||
// NewCmdUpgradeNodeConfig returns the cobra.Command for downloading the new/upgrading the kubelet configuration from the kubelet-config-1.X
|
||||
// ConfigMap in the cluster
|
||||
// TODO: to remove when 1.18 is released
|
||||
func NewCmdUpgradeNodeConfig() *cobra.Command {
|
||||
nodeOptions := newNodeOptions()
|
||||
nodeRunner := workflow.NewRunner()
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "config",
|
||||
Short: "Download the kubelet configuration from the cluster ConfigMap kubelet-config-1.X, where X is the minor version of the kubelet",
|
||||
Deprecated: "use \"kubeadm upgrade node\" instead",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
// This is required for preserving the old behavior of `kubeadm upgrade node config`.
|
||||
// The new implementation exposed as a phase under `kubeadm upgrade node` infers the target
|
||||
// kubelet config version from the kubeadm-config ConfigMap
|
||||
if len(nodeOptions.kubeletVersion) == 0 {
|
||||
return errors.New("the --kubelet-version argument is required")
|
||||
}
|
||||
|
||||
return nodeRunner.Run(args)
|
||||
},
|
||||
}
|
||||
|
||||
// adds flags to the node command
|
||||
addUpgradeNodeFlags(cmd.Flags(), nodeOptions)
|
||||
|
||||
// initialize the workflow runner with the list of phases
|
||||
nodeRunner.AppendPhase(phases.NewKubeletConfigPhase())
|
||||
|
||||
// sets the data builder function, that will be used by the runner
|
||||
// both when running the entire workflow or single phases
|
||||
nodeRunner.SetDataInitializer(func(cmd *cobra.Command, args []string) (workflow.RunData, error) {
|
||||
return newNodeData(cmd, args, nodeOptions)
|
||||
})
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user