Move `diff` command to root rather than alpha

New command is now `kubectl diff` rather than `kubectl alpha diff` since
it's moving out of alpha soon, and will be using dry-run apply to
produce the diff rather than the custom merge logic.
pull/58/head
Antoine Pelisse 2018-09-27 11:08:55 -07:00
parent 0787715978
commit e1eadc5031
8 changed files with 10 additions and 10 deletions

View File

@ -194,7 +194,6 @@ docs/man/man1/kubeadm-upgrade-plan.1
docs/man/man1/kubeadm-upgrade.1
docs/man/man1/kubeadm-version.1
docs/man/man1/kubeadm.1
docs/man/man1/kubectl-alpha-diff.1
docs/man/man1/kubectl-alpha.1
docs/man/man1/kubectl-annotate.1
docs/man/man1/kubectl-api-resources.1
@ -255,6 +254,7 @@ docs/man/man1/kubectl-create-serviceaccount.1
docs/man/man1/kubectl-create.1
docs/man/man1/kubectl-delete.1
docs/man/man1/kubectl-describe.1
docs/man/man1/kubectl-diff.1
docs/man/man1/kubectl-drain.1
docs/man/man1/kubectl-edit.1
docs/man/man1/kubectl-exec.1
@ -297,8 +297,6 @@ docs/man/man1/kubectl-wait.1
docs/man/man1/kubectl.1
docs/man/man1/kubelet.1
docs/user-guide/kubectl/kubectl.md
docs/user-guide/kubectl/kubectl_alpha.md
docs/user-guide/kubectl/kubectl_alpha_diff.md
docs/user-guide/kubectl/kubectl_annotate.md
docs/user-guide/kubectl/kubectl_api-resources.md
docs/user-guide/kubectl/kubectl_api-versions.md
@ -358,6 +356,7 @@ docs/user-guide/kubectl/kubectl_create_service_nodeport.md
docs/user-guide/kubectl/kubectl_create_serviceaccount.md
docs/user-guide/kubectl/kubectl_delete.md
docs/user-guide/kubectl/kubectl_describe.md
docs/user-guide/kubectl/kubectl_diff.md
docs/user-guide/kubectl/kubectl_drain.md
docs/user-guide/kubectl/kubectl_edit.md
docs/user-guide/kubectl/kubectl_exec.md
@ -414,6 +413,7 @@ docs/yaml/kubectl/kubectl_cp.yaml
docs/yaml/kubectl/kubectl_create.yaml
docs/yaml/kubectl/kubectl_delete.yaml
docs/yaml/kubectl/kubectl_describe.yaml
docs/yaml/kubectl/kubectl_diff.yaml
docs/yaml/kubectl/kubectl_drain.yaml
docs/yaml/kubectl/kubectl_edit.yaml
docs/yaml/kubectl/kubectl_exec.yaml

View File

@ -36,7 +36,6 @@ func NewCmdAlpha(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.
// Alpha commands should be added here. As features graduate from alpha they should move
// from here to the CommandGroups defined by NewKubeletCommand() in cmd.go.
//cmd.AddCommand(NewCmdDebug(f, in, out, err))
cmd.AddCommand(NewCmdDiff(f, streams))
// NewKubeletCommand() will hide the alpha command if it has no subcommands. Overriding
// the help function ensures a reasonable message if someone types the hidden command anyway.

View File

@ -468,6 +468,7 @@ func NewKubectlCommand(in io.Reader, out, err io.Writer) *cobra.Command {
{
Message: "Advanced Commands:",
Commands: []*cobra.Command{
NewCmdDiff(f, ioStreams),
NewCmdApply("kubectl", f, ioStreams),
NewCmdPatch(f, ioStreams),
NewCmdReplace(f, ioStreams),

View File

@ -54,10 +54,10 @@ var (
run with "-u" (unicode) and "-N" (treat new files as empty) options.`))
diffExample = templates.Examples(i18n.T(`
# Diff resources included in pod.json.
kubectl alpha diff -f pod.json
kubectl diff -f pod.json
# Diff file read from stdin
cat service.yaml | kubectl alpha diff -f -`))
cat service.yaml | kubectl diff -f -`))
)
type DiffOptions struct {

View File

@ -18,21 +18,21 @@ set -o errexit
set -o nounset
set -o pipefail
# Runs tests for kubectl alpha diff
# Runs tests for kubectl diff
run_kubectl_diff_tests() {
set -o nounset
set -o errexit
create_and_use_new_namespace
kube::log::status "Testing kubectl alpha diff"
kube::log::status "Testing kubectl diff"
# Test that it works when the live object doesn't exist
output_message=$(kubectl alpha diff -f hack/testdata/pod.yaml)
output_message=$(kubectl diff -f hack/testdata/pod.yaml)
kube::test::if_has_string "${output_message}" 'test-pod'
kubectl apply -f hack/testdata/pod.yaml
output_message=$(kubectl alpha diff -f hack/testdata/pod-changed.yaml)
output_message=$(kubectl diff -f hack/testdata/pod-changed.yaml)
kube::test::if_has_string "${output_message}" 'k8s.gcr.io/pause:3.0'
kubectl delete -f hack/testdata/pod.yaml