Skip to content

Commit

Permalink
Add namespace for direct velero commands. (#1037)
Browse files Browse the repository at this point in the history
Without this, the velero command is not able to find individual
backups or restores when collecting logs.

Signed-off-by: Matthew Arnold <marnold@redhat.com>
Co-authored-by: Matthew Arnold <marnold@redhat.com>
  • Loading branch information
openshift-cherrypick-robot and mrnold committed May 24, 2023
1 parent ac5d08a commit 26be9f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions must-gather/collection-scripts/logs/gather_logs_backup
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ skip_tls=$8
mkdir -p "${object_collection_path}"
echo "[cluster=${cluster}][ns=${ns}] Gathering 'velero backup describe ${backup}'"
if [ "$timeout" = "0s" ]; then
timeout 30s velero describe backup ${backup} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/backup-describe-${backup}.txt" &
timeout 30s velero describe backup ${backup} --namespace ${ns} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/backup-describe-${backup}.txt" &
else
timeout ${timeout} velero describe backup ${backup} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/backup-describe-${backup}.txt" &
timeout ${timeout} velero describe backup ${backup} --namespace ${ns} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/backup-describe-${backup}.txt" &
fi
echo "[cluster=${cluster}][ns=${ns}] Gathering 'velero backup logs ${backup}'"
timeout 30s velero backup logs ${backup} --insecure-skip-tls-verify=${skip_tls} --timeout=30s &> "${object_collection_path}/backup-${backup}.log" &
timeout 30s velero backup logs ${backup} --namespace ${ns} --insecure-skip-tls-verify=${skip_tls} --timeout=30s &> "${object_collection_path}/backup-${backup}.log" &

wait
6 changes: 3 additions & 3 deletions must-gather/collection-scripts/logs/gather_logs_restore
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ skip_tls=$8
mkdir -p "${object_collection_path}"
echo "[cluster=${cluster}][ns=${ns}] Gathering 'velero restore describe ${restore}'"
if [ "$timeout" = "0s" ]; then
timeout 30s velero describe restore ${restore} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/restore-describe-${restore}.txt" &
timeout 30s velero describe restore ${restore} --namespace ${ns} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/restore-describe-${restore}.txt" &
else
timeout ${timeout} velero describe restore ${restore} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/restore-describe-${restore}.txt" &
timeout ${timeout} velero describe restore ${restore} --namespace ${ns} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/restore-describe-${restore}.txt" &
fi
echo "[cluster=${cluster}][ns=${ns}] Gathering 'velero restore logs ${restore}'"
timeout 30s velero restore logs ${restore} --insecure-skip-tls-verify=${skip_tls} --timeout=30s &> "${object_collection_path}/restore-${restore}.log" &
timeout 30s velero restore logs ${restore} --namespace ${ns} --insecure-skip-tls-verify=${skip_tls} --timeout=30s &> "${object_collection_path}/restore-${restore}.log" &

wait

0 comments on commit 26be9f7

Please sign in to comment.