Skip to content

Commit 5835cdb

Browse files
committed
k8s-sysreport: Create dovecot-sysreport to /tmp in container
1 parent ce5b83f commit 5835cdb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

k8s-sysreport.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ while [[ $# -gt 0 ]]; do
6565
done
6666

6767
log() { printf '[%s] %s\n' "$(date -u +%H:%M:%S)" "$*" >&2; }
68-
find_ds_archive_cmd='ls -1t dovecot-sysreport-*.tar.* 2>/dev/null | head -n1'
68+
find_ds_archive_cmd='ls -1t /tmp/dovecot-sysreport-*.tar.* 2>/dev/null | head -n1'
6969

7070
# ------------------------------------------------------------------------------
7171
# Mode A: Host (kubectl) mode
@@ -89,7 +89,7 @@ if [[ -n "$NS" && -n "$POD" ]]; then
8989
fi
9090

9191
# Build dovecot-sysreport command
92-
DS_CMD="dovecot-sysreport"
92+
DS_CMD="dovecot-sysreport -d /tmp/dovecot-sysreport-$(uname -n)-$(date +'%s').tar.gz"
9393
if [[ -n "$CORE_IN_POD_PATH" ]]; then
9494
DS_CMD="$DS_CMD --core $CORE_IN_POD_PATH"
9595
fi

test-k8s-sysreport.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cat > "$MOCKROOT/bin/dovecot-sysreport" <<'EOF'
2222
#!/usr/bin/env bash
2323
# Creates a tarball under /tmp to simulate real dovecot-sysreport output
2424
STAMP="$(date -u +%Y%m%dT%H%M%SZ)"
25-
OUT="/tmp/dovecot-sysreport-${STAMP}.tar.gz"
25+
OUT="dovecot-sysreport-${STAMP}.tar.gz"
2626
TMPD="$(mktemp -d)"
2727
echo "mock dovecot report" > "$TMPD/report.txt"
2828
tar -czf "$OUT" -C "$TMPD" report.txt

0 commit comments

Comments
 (0)