From d6aca27b53e3f9f9562e4494ee2eb2310ab29615 Mon Sep 17 00:00:00 2001 From: xiangpengzhao Date: Tue, 1 Aug 2017 17:40:34 +0800 Subject: [PATCH] Remove deprecated kubectl command aliases --- docs/.generated_docs | 13 ---------- docs/man/man1/kubectl-apiversions.1 | 3 --- docs/man/man1/kubectl-clusterinfo-dump.1 | 3 --- docs/man/man1/kubectl-clusterinfo.1 | 3 --- docs/man/man1/kubectl-resize.1 | 3 --- docs/man/man1/kubectl-rollingupdate.1 | 3 --- docs/man/man1/kubectl-run-container.1 | 3 --- docs/man/man1/kubectl-update.1 | 3 --- docs/yaml/kubectl/kubectl_apiversions.yaml | 3 --- docs/yaml/kubectl/kubectl_clusterinfo.yaml | 3 --- docs/yaml/kubectl/kubectl_resize.yaml | 3 --- docs/yaml/kubectl/kubectl_rollingupdate.yaml | 3 --- docs/yaml/kubectl/kubectl_run-container.yaml | 3 --- docs/yaml/kubectl/kubectl_update.yaml | 3 --- hack/make-rules/test-cmd-util.sh | 26 -------------------- pkg/kubectl/cmd/cmd.go | 6 ----- 16 files changed, 84 deletions(-) delete mode 100644 docs/man/man1/kubectl-apiversions.1 delete mode 100644 docs/man/man1/kubectl-clusterinfo-dump.1 delete mode 100644 docs/man/man1/kubectl-clusterinfo.1 delete mode 100644 docs/man/man1/kubectl-resize.1 delete mode 100644 docs/man/man1/kubectl-rollingupdate.1 delete mode 100644 docs/man/man1/kubectl-run-container.1 delete mode 100644 docs/man/man1/kubectl-update.1 delete mode 100644 docs/yaml/kubectl/kubectl_apiversions.yaml delete mode 100644 docs/yaml/kubectl/kubectl_clusterinfo.yaml delete mode 100644 docs/yaml/kubectl/kubectl_resize.yaml delete mode 100644 docs/yaml/kubectl/kubectl_rollingupdate.yaml delete mode 100644 docs/yaml/kubectl/kubectl_run-container.yaml delete mode 100644 docs/yaml/kubectl/kubectl_update.yaml diff --git a/docs/.generated_docs b/docs/.generated_docs index 6cb4e01c471..0ffec2e8b5b 100644 --- a/docs/.generated_docs +++ b/docs/.generated_docs @@ -21,7 +21,6 @@ docs/man/man1/kube-scheduler.1 docs/man/man1/kubectl-alpha.1 docs/man/man1/kubectl-annotate.1 docs/man/man1/kubectl-api-versions.1 -docs/man/man1/kubectl-apiversions.1 docs/man/man1/kubectl-apply-edit-last-applied.1 docs/man/man1/kubectl-apply-set-last-applied.1 docs/man/man1/kubectl-apply-view-last-applied.1 @@ -35,8 +34,6 @@ docs/man/man1/kubectl-certificate-deny.1 docs/man/man1/kubectl-certificate.1 docs/man/man1/kubectl-cluster-info-dump.1 docs/man/man1/kubectl-cluster-info.1 -docs/man/man1/kubectl-clusterinfo-dump.1 -docs/man/man1/kubectl-clusterinfo.1 docs/man/man1/kubectl-completion.1 docs/man/man1/kubectl-config-current-context.1 docs/man/man1/kubectl-config-delete-cluster.1 @@ -91,16 +88,13 @@ docs/man/man1/kubectl-plugin.1 docs/man/man1/kubectl-port-forward.1 docs/man/man1/kubectl-proxy.1 docs/man/man1/kubectl-replace.1 -docs/man/man1/kubectl-resize.1 docs/man/man1/kubectl-rolling-update.1 -docs/man/man1/kubectl-rollingupdate.1 docs/man/man1/kubectl-rollout-history.1 docs/man/man1/kubectl-rollout-pause.1 docs/man/man1/kubectl-rollout-resume.1 docs/man/man1/kubectl-rollout-status.1 docs/man/man1/kubectl-rollout-undo.1 docs/man/man1/kubectl-rollout.1 -docs/man/man1/kubectl-run-container.1 docs/man/man1/kubectl-run.1 docs/man/man1/kubectl-scale.1 docs/man/man1/kubectl-set-image.1 @@ -114,7 +108,6 @@ docs/man/man1/kubectl-top-node.1 docs/man/man1/kubectl-top-pod.1 docs/man/man1/kubectl-top.1 docs/man/man1/kubectl-uncordon.1 -docs/man/man1/kubectl-update.1 docs/man/man1/kubectl-version.1 docs/man/man1/kubectl.1 docs/man/man1/kubelet.1 @@ -212,14 +205,12 @@ docs/yaml/kubectl/kubectl.yaml docs/yaml/kubectl/kubectl_alpha.yaml docs/yaml/kubectl/kubectl_annotate.yaml docs/yaml/kubectl/kubectl_api-versions.yaml -docs/yaml/kubectl/kubectl_apiversions.yaml docs/yaml/kubectl/kubectl_apply.yaml docs/yaml/kubectl/kubectl_attach.yaml docs/yaml/kubectl/kubectl_auth.yaml docs/yaml/kubectl/kubectl_autoscale.yaml docs/yaml/kubectl/kubectl_certificate.yaml docs/yaml/kubectl/kubectl_cluster-info.yaml -docs/yaml/kubectl/kubectl_clusterinfo.yaml docs/yaml/kubectl/kubectl_completion.yaml docs/yaml/kubectl/kubectl_config.yaml docs/yaml/kubectl/kubectl_convert.yaml @@ -242,11 +233,8 @@ docs/yaml/kubectl/kubectl_plugin.yaml docs/yaml/kubectl/kubectl_port-forward.yaml docs/yaml/kubectl/kubectl_proxy.yaml docs/yaml/kubectl/kubectl_replace.yaml -docs/yaml/kubectl/kubectl_resize.yaml docs/yaml/kubectl/kubectl_rolling-update.yaml -docs/yaml/kubectl/kubectl_rollingupdate.yaml docs/yaml/kubectl/kubectl_rollout.yaml -docs/yaml/kubectl/kubectl_run-container.yaml docs/yaml/kubectl/kubectl_run.yaml docs/yaml/kubectl/kubectl_scale.yaml docs/yaml/kubectl/kubectl_set.yaml @@ -254,5 +242,4 @@ docs/yaml/kubectl/kubectl_stop.yaml docs/yaml/kubectl/kubectl_taint.yaml docs/yaml/kubectl/kubectl_top.yaml docs/yaml/kubectl/kubectl_uncordon.yaml -docs/yaml/kubectl/kubectl_update.yaml docs/yaml/kubectl/kubectl_version.yaml diff --git a/docs/man/man1/kubectl-apiversions.1 b/docs/man/man1/kubectl-apiversions.1 deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/man/man1/kubectl-apiversions.1 +++ /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. diff --git a/docs/man/man1/kubectl-clusterinfo-dump.1 b/docs/man/man1/kubectl-clusterinfo-dump.1 deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/man/man1/kubectl-clusterinfo-dump.1 +++ /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. diff --git a/docs/man/man1/kubectl-clusterinfo.1 b/docs/man/man1/kubectl-clusterinfo.1 deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/man/man1/kubectl-clusterinfo.1 +++ /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. diff --git a/docs/man/man1/kubectl-resize.1 b/docs/man/man1/kubectl-resize.1 deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/man/man1/kubectl-resize.1 +++ /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. diff --git a/docs/man/man1/kubectl-rollingupdate.1 b/docs/man/man1/kubectl-rollingupdate.1 deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/man/man1/kubectl-rollingupdate.1 +++ /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. diff --git a/docs/man/man1/kubectl-run-container.1 b/docs/man/man1/kubectl-run-container.1 deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/man/man1/kubectl-run-container.1 +++ /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. diff --git a/docs/man/man1/kubectl-update.1 b/docs/man/man1/kubectl-update.1 deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/man/man1/kubectl-update.1 +++ /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. diff --git a/docs/yaml/kubectl/kubectl_apiversions.yaml b/docs/yaml/kubectl/kubectl_apiversions.yaml deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/yaml/kubectl/kubectl_apiversions.yaml +++ /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. diff --git a/docs/yaml/kubectl/kubectl_clusterinfo.yaml b/docs/yaml/kubectl/kubectl_clusterinfo.yaml deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/yaml/kubectl/kubectl_clusterinfo.yaml +++ /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. diff --git a/docs/yaml/kubectl/kubectl_resize.yaml b/docs/yaml/kubectl/kubectl_resize.yaml deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/yaml/kubectl/kubectl_resize.yaml +++ /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. diff --git a/docs/yaml/kubectl/kubectl_rollingupdate.yaml b/docs/yaml/kubectl/kubectl_rollingupdate.yaml deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/yaml/kubectl/kubectl_rollingupdate.yaml +++ /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. diff --git a/docs/yaml/kubectl/kubectl_run-container.yaml b/docs/yaml/kubectl/kubectl_run-container.yaml deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/yaml/kubectl/kubectl_run-container.yaml +++ /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. diff --git a/docs/yaml/kubectl/kubectl_update.yaml b/docs/yaml/kubectl/kubectl_update.yaml deleted file mode 100644 index b6fd7a0f989..00000000000 --- a/docs/yaml/kubectl/kubectl_update.yaml +++ /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. diff --git a/hack/make-rules/test-cmd-util.sh b/hack/make-rules/test-cmd-util.sh index 7490b6525f3..354aeaa9ff3 100644 --- a/hack/make-rules/test-cmd-util.sh +++ b/hack/make-rules/test-cmd-util.sh @@ -1222,31 +1222,6 @@ run_kubectl_run_tests() { set +o errexit } -run_kubectl_using_deprecated_commands_test() { - set -o nounset - set -o errexit - - create_and_use_new_namespace - kube::log::status "Testing kubectl using deprecated commands" - ## `kubectl run-container` should function identical to `kubectl run`, but it - ## should also print a deprecation warning. - # Pre-Condition: no Job exists - kube::test::get_object_assert jobs "{{range.items}}{{$id_field}}:{{end}}" '' - # Command - output_message=$(kubectl 2>&1 run-container pi --generator=job/v1 "--image=$IMAGE_PERL" --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(15)' "${kube_flags[@]}") - # Ensure that the user is warned their command is deprecated. - kube::test::if_has_string "${output_message}" 'deprecated' - # Post-Condition: Job "pi" is created - kube::test::get_object_assert jobs "{{range.items}}{{$id_field}}:{{end}}" 'pi:' - # Clean up - kubectl delete jobs pi "${kube_flags[@]}" - # Post-condition: no pods exist. - kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' - - set +o nounset - set +o errexit -} - run_kubectl_get_tests() { set -o nounset set -o errexit @@ -4279,7 +4254,6 @@ runTests() { # run for federation apiserver as well. record_command run_kubectl_apply_tests record_command run_kubectl_run_tests - record_command run_kubectl_using_deprecated_commands_test record_command run_kubectl_create_filter_tests fi diff --git a/pkg/kubectl/cmd/cmd.go b/pkg/kubectl/cmd/cmd.go index 50f442f4ea1..76a0777c022 100644 --- a/pkg/kubectl/cmd/cmd.go +++ b/pkg/kubectl/cmd/cmd.go @@ -285,7 +285,6 @@ func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cob NewCmdCreate(f, out, err), NewCmdExposeService(f, out), NewCmdRun(f, in, out, err), - deprecatedAlias("run-container", NewCmdRun(f, in, out, err)), set.NewCmdSet(f, out, err), }, }, @@ -303,9 +302,7 @@ func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cob Commands: []*cobra.Command{ rollout.NewCmdRollout(f, out, err), NewCmdRollingUpdate(f, out), - deprecatedAlias("rollingupdate", NewCmdRollingUpdate(f, out)), NewCmdScale(f, out), - deprecatedAlias("resize", NewCmdScale(f, out)), NewCmdAutoscale(f, out), }, }, @@ -314,7 +311,6 @@ func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cob Commands: []*cobra.Command{ NewCmdCertificate(f, out), NewCmdClusterInfo(f, out), - deprecatedAlias("clusterinfo", NewCmdClusterInfo(f, out)), NewCmdTop(f, out, err), NewCmdCordon(f, out), NewCmdUncordon(f, out), @@ -341,7 +337,6 @@ func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cob NewCmdApply("kubectl", f, out, err), NewCmdPatch(f, out), NewCmdReplace(f, out), - deprecatedAlias("update", NewCmdReplace(f, out)), NewCmdConvert(f, out), }, }, @@ -386,7 +381,6 @@ func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cob cmds.AddCommand(NewCmdPlugin(f, in, out, err)) cmds.AddCommand(NewCmdVersion(f, out)) cmds.AddCommand(NewCmdApiVersions(f, out)) - cmds.AddCommand(deprecatedAlias("apiversions", NewCmdApiVersions(f, out))) cmds.AddCommand(NewCmdOptions(out)) return cmds