Merge pull request #87805 from zhouya0/add_kubectl_diff_exit_code_doc

Add kubectl diff exit code doc
This commit is contained in:
Kubernetes Prow Robot 2020-02-11 23:14:45 -08:00 committed by GitHub
commit e13463d755
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -42,3 +42,17 @@ export KUBECTL_EXTERNAL_DIFF=meld; kubectl diff -k ./dir/
{% endmethod %}
{% method %}
## Exit status
The following exit values shall be returned:
`0`
No differences were found.
`1`
Differences were found.
`>1`
Kubectl or diff failed with an error.
**Note:** `KUBECTL_EXTERNAL_DIFF`, if used, is expected to follow that convention.
{% endmethod %}

View File

@ -56,7 +56,18 @@ var (
KUBECTL_EXTERNAL_DIFF environment variable can be used to select your own
diff command. By default, the "diff" command available in your path will be
run with "-u" (unified diff) and "-N" (treat absent files as empty) options.`))
run with "-u" (unified diff) and "-N" (treat absent files as empty) options.
Exit status:
0
No differences were found.
1
Differences were found.
>1
Kubectl or diff failed with an error.
Note: KUBECTL_EXTERNAL_DIFF, if used, is expected to follow that convention.`))
diffExample = templates.Examples(i18n.T(`
# Diff resources included in pod.json.
kubectl diff -f pod.json