diff --git a/changelogs/unreleased/7679-allenxu404 b/changelogs/unreleased/7679-allenxu404 new file mode 100644 index 0000000000..d8a5914bf8 --- /dev/null +++ b/changelogs/unreleased/7679-allenxu404 @@ -0,0 +1 @@ +Modify hook docs for clarity on displaying hook execution results \ No newline at end of file diff --git a/site/content/docs/main/backup-hooks.md b/site/content/docs/main/backup-hooks.md index 87310fbb3c..67297d9a05 100644 --- a/site/content/docs/main/backup-hooks.md +++ b/site/content/docs/main/backup-hooks.md @@ -102,6 +102,22 @@ pre: Note that the container must support the shell command you use. +## Backup Hook Execution Results +### Viewing Results + +Velero records the execution results of hooks, allowing users to obtain this information by running the following command: + +```bash +$ velero backup describe +``` + +The displayed results include the number of hooks that were attempted to be executed and the number of hooks that failed execution. Any detailed failure reasons will be present in `Errors` section if applicable. + +```bash +HooksAttempted: 1 +HooksFailed: 0 +``` + [1]: api-types/backup.md [2]: https://github.com/vmware-tanzu/velero/blob/main/examples/nginx-app/with-pv.yaml diff --git a/site/content/docs/main/restore-hooks.md b/site/content/docs/main/restore-hooks.md index f36f348419..b5681733eb 100644 --- a/site/content/docs/main/restore-hooks.md +++ b/site/content/docs/main/restore-hooks.md @@ -280,4 +280,21 @@ postHooks: Note that the container must support the shell command you use. +## Restore Hook Execution Results +### Viewing Results + +Velero records the execution results of hooks, allowing users to obtain this information by running the following command: + +```bash +$ velero restore describe +``` + +The displayed results include the number of hooks that were attempted to be executed and the number of hooks that failed execution. Any detailed failure reasons will be present in `Errors` section if applicable. + +```bash +HooksAttempted: 1 +HooksFailed: 0 +``` + + [1]: api-types/restore.md