Add kubectl diff exit code doc

This commit is contained in:
zhouya0 2020-02-04 17:22:23 +08:00
parent 5caeec8023
commit 527e66fc28
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 %} {% 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 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 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(` diffExample = templates.Examples(i18n.T(`
# Diff resources included in pod.json. # Diff resources included in pod.json.
kubectl diff -f pod.json kubectl diff -f pod.json