Skip to content

Commit df908c3

Browse files
authored
Merge pull request kubernetes#87975 from SataQiu/kubeadm-20200210
kubeadm: remove 'kubeadm upgrade node config' command when v1.18 is released
2 parents 86ed97f + f215058 commit df908c3

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

cmd/kubeadm/app/cmd/upgrade/node.go

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ func NewCmdNode() *cobra.Command {
9393
// command help, adding --skip-phases flag and by adding phases subcommands
9494
nodeRunner.BindToCommand(cmd)
9595

96-
// upgrade node config command is subject to GA deprecation policy, so we should deprecate it
97-
// and keep it here for one year or three releases - the longer of the two - starting from v1.15 included
98-
cmd.AddCommand(NewCmdUpgradeNodeConfig())
99-
10096
return cmd
10197
}
10298

@@ -195,41 +191,3 @@ func (d *nodeData) Client() clientset.Interface {
195191
func (d *nodeData) KustomizeDir() string {
196192
return d.kustomizeDir
197193
}
198-
199-
// NewCmdUpgradeNodeConfig returns the cobra.Command for downloading the new/upgrading the kubelet configuration from the kubelet-config-1.X
200-
// ConfigMap in the cluster
201-
// TODO: to remove when 1.18 is released
202-
func NewCmdUpgradeNodeConfig() *cobra.Command {
203-
nodeOptions := newNodeOptions()
204-
nodeRunner := workflow.NewRunner()
205-
206-
cmd := &cobra.Command{
207-
Use: "config",
208-
Short: "Download the kubelet configuration from the cluster ConfigMap kubelet-config-1.X, where X is the minor version of the kubelet",
209-
Deprecated: "use \"kubeadm upgrade node\" instead",
210-
RunE: func(cmd *cobra.Command, args []string) error {
211-
// This is required for preserving the old behavior of `kubeadm upgrade node config`.
212-
// The new implementation exposed as a phase under `kubeadm upgrade node` infers the target
213-
// kubelet config version from the kubeadm-config ConfigMap
214-
if len(nodeOptions.kubeletVersion) == 0 {
215-
return errors.New("the --kubelet-version argument is required")
216-
}
217-
218-
return nodeRunner.Run(args)
219-
},
220-
}
221-
222-
// adds flags to the node command
223-
addUpgradeNodeFlags(cmd.Flags(), nodeOptions)
224-
225-
// initialize the workflow runner with the list of phases
226-
nodeRunner.AppendPhase(phases.NewKubeletConfigPhase())
227-
228-
// sets the data builder function, that will be used by the runner
229-
// both when running the entire workflow or single phases
230-
nodeRunner.SetDataInitializer(func(cmd *cobra.Command, args []string) (workflow.RunData, error) {
231-
return newNodeData(cmd, args, nodeOptions)
232-
})
233-
234-
return cmd
235-
}

0 commit comments

Comments
 (0)