From 50bbe5781152ea631c9da374e99f4390463c6d12 Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Fri, 16 Mar 2018 17:20:14 +0100 Subject: [PATCH 1/3] Deprecate kubectl rolling-update --- pkg/kubectl/cmd/rollingupdate.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/kubectl/cmd/rollingupdate.go b/pkg/kubectl/cmd/rollingupdate.go index 029adb8aae6..e7a003b4910 100644 --- a/pkg/kubectl/cmd/rollingupdate.go +++ b/pkg/kubectl/cmd/rollingupdate.go @@ -81,9 +81,11 @@ func NewCmdRollingUpdate(f cmdutil.Factory, out io.Writer) *cobra.Command { cmd := &cobra.Command{ Use: "rolling-update OLD_CONTROLLER_NAME ([NEW_CONTROLLER_NAME] --image=NEW_CONTAINER_IMAGE | -f NEW_CONTROLLER_SPEC)", DisableFlagsInUseLine: true, - Short: i18n.T("Perform a rolling update of the given ReplicationController"), - Long: rollingUpdateLong, - Example: rollingUpdateExample, + Short: "Perform a rolling update. This command is deprecated, use rollout instead.", + Long: rollingUpdateLong, + Example: rollingUpdateExample, + Deprecated: `use "rollout" instead`, + Hidden: true, Run: func(cmd *cobra.Command, args []string) { err := RunRollingUpdate(f, out, cmd, args, options) cmdutil.CheckErr(err) From d82f452b850b0760111133864e8fe28afcf572fb Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Fri, 20 Apr 2018 16:50:57 +0200 Subject: [PATCH 2/3] Filter unavailable commands in help --- pkg/kubectl/cmd/templates/templater.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubectl/cmd/templates/templater.go b/pkg/kubectl/cmd/templates/templater.go index 27b76dc42b7..0892f040318 100644 --- a/pkg/kubectl/cmd/templates/templater.go +++ b/pkg/kubectl/cmd/templates/templater.go @@ -145,7 +145,7 @@ func (t *templater) cmdGroupsString(c *cobra.Command) string { for _, cmdGroup := range t.cmdGroups(c, c.Commands()) { cmds := []string{cmdGroup.Message} for _, cmd := range cmdGroup.Commands { - if cmd.Runnable() { + if cmd.IsAvailableCommand() { cmds = append(cmds, " "+rpad(cmd.Name(), cmd.NamePadding())+" "+cmd.Short) } } From 8237e1a0344a5d824934e3b0faa64ef413ad6822 Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Wed, 25 Apr 2018 13:09:12 +0200 Subject: [PATCH 3/3] Generated changes --- docs/.generated_docs | 1 - docs/user-guide/kubectl/kubectl_rolling-update.md | 3 --- 2 files changed, 4 deletions(-) delete mode 100644 docs/user-guide/kubectl/kubectl_rolling-update.md diff --git a/docs/.generated_docs b/docs/.generated_docs index c0198d7757b..2cc9efd5b97 100644 --- a/docs/.generated_docs +++ b/docs/.generated_docs @@ -316,7 +316,6 @@ docs/user-guide/kubectl/kubectl_plugin.md docs/user-guide/kubectl/kubectl_port-forward.md docs/user-guide/kubectl/kubectl_proxy.md docs/user-guide/kubectl/kubectl_replace.md -docs/user-guide/kubectl/kubectl_rolling-update.md docs/user-guide/kubectl/kubectl_rollout.md docs/user-guide/kubectl/kubectl_rollout_history.md docs/user-guide/kubectl/kubectl_rollout_pause.md diff --git a/docs/user-guide/kubectl/kubectl_rolling-update.md b/docs/user-guide/kubectl/kubectl_rolling-update.md deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/user-guide/kubectl/kubectl_rolling-update.md +++ /dev/null @@ -1,3 +0,0 @@ -This file is autogenerated, but we've stopped checking such files into the -repository to reduce the need for rebases. Please run hack/generate-docs.sh to -populate this file.