Skip to content

Commit d9d3a45

Browse files
Merge pull request #60 from Akrog/fix-pod-logs
Fix pod log gathering
2 parents 77ecf2b + 3f41600 commit d9d3a45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

collection-scripts/gather_sos

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,15 @@ gather_node_sos () {
7373
# To avoid performance penalty we don't look for the real directory name using:
7474
# $(tar --exclude='*/*' -tf "${FILENAME}" | head -n1)
7575
# Instead we use a fake podlogs top directory
76+
# - Ignore warning exit code (1) from tar, and only consider it a failure on error code (2)
7677
oc debug "node/$node" -- chroot /host bash \
7778
-c "echo 'TOOLBOX_NAME=toolbox-osp' > /root/.toolboxrc ; \
7879
rm -rf \"${TMPDIR}\" && \
7980
mkdir -p \"${TMPDIR}\" && \
8081
sudo podman rm --force toolbox-osp; \
8182
sudo --preserve-env podman pull --authfile /var/lib/kubelet/config.json registry.redhat.io/rhel9/support-tools && \
8283
toolbox sos report --batch $SOS_LIMIT --tmp-dir=\"${TMPDIR}\" && \
83-
tar --warning=no-file-changed -cJf \"${TMPDIR}/podlogs.tar.xz\" --transform 's,^,podlogs/,' /var/log/pods"
84+
tar --warning=no-file-changed -cJf \"${TMPDIR}/podlogs.tar.xz\" --transform 's,^,podlogs/,' /var/log/pods; [ \$? -lt 2 ]"
8485

8586
# shellcheck disable=SC2181
8687
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)