From 9b7f2da19250e8860f72cc04b6dc14db2810c425 Mon Sep 17 00:00:00 2001 From: Daniel Jiang Date: Tue, 21 Sep 2021 20:16:31 +0800 Subject: [PATCH] run backup/restore describe in debug subcommand (#4161) The errors of restore/backup may be stored in object storage The well formatted output of describe is also helpful for debugging. This commit add the command to the crashd script so the output of "velero backup/restore describe xxx" can be collected Signed-off-by: Daniel Jiang --- pkg/cmd/cli/debug/cshd-scripts/velero.cshd | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/cli/debug/cshd-scripts/velero.cshd b/pkg/cmd/cli/debug/cshd-scripts/velero.cshd index 3985bb275..29e27f753 100644 --- a/pkg/cmd/cli/debug/cshd-scripts/velero.cshd +++ b/pkg/cmd/cli/debug/cshd-scripts/velero.cshd @@ -1,11 +1,15 @@ def capture_backup_logs(cmd, namespace): if args.backup: - log("Collecting log for backup: {}".format(args.backup)) + log("Collecting log and information for backup: {}".format(args.backup)) + backupDescCmd = "{} --namespace={} backup describe {} --details".format(cmd, namespace, args.backup) + capture_local(cmd=backupDescCmd, file_name="backup_describe_{}.txt".format(args.backup)) backupLogsCmd = "{} --namespace={} backup logs {}".format(cmd, namespace, args.backup) capture_local(cmd=backupLogsCmd, file_name="backup_{}.log".format(args.backup)) def capture_restore_logs(cmd, namespace): if args.restore: - log("Collecting log for restore: {}".format(args.restore)) + log("Collecting log and information for restore: {}".format(args.restore)) + restoreDescCmd = "{} --namespace={} restore describe {} --details".format(cmd, namespace, args.restore) + capture_local(cmd=restoreDescCmd, file_name="restore_describe_{}.txt".format(args.restore)) restoreLogsCmd = "{} --namespace={} restore logs {}".format(cmd, namespace, args.restore) capture_local(cmd=restoreLogsCmd, file_name="restore_{}.log".format(args.restore))