fix Proxmox snippet storage detection
Kube-bench CIS scan / Scan ephemeral K3s cluster (push) Failing after 3m28s

This commit is contained in:
2026-08-11 16:49:04 -04:00
parent 2a9d312326
commit 97320318f4
@@ -87,8 +87,8 @@ if qm status "$VM_ID" >/dev/null 2>&1; then
die "VM $VM_ID already exists; choose another VM_ID" die "VM $VM_ID already exists; choose another VM_ID"
fi fi
storage_config="$(pvesm config "$SNIPPET_STORAGE" 2>/dev/null || true)" snippet_storages="$(pvesm status --content snippets 2>/dev/null || true)"
grep -Eq '(^|,)snippets(,|$)' <<<"$storage_config" || die "storage $SNIPPET_STORAGE is not configured for snippets. Enable it with: pvesm set $SNIPPET_STORAGE --content snippets" awk -v storage="$SNIPPET_STORAGE" '$1 == storage {found = 1} END {exit !found}' <<<"$snippet_storages" || die "storage $SNIPPET_STORAGE is not configured for snippets. Enable it with: pvesm set $SNIPPET_STORAGE --content snippets"
mkdir -p "$SNIPPET_DIR" "$IMAGE_CACHE_DIR" mkdir -p "$SNIPPET_DIR" "$IMAGE_CACHE_DIR"
chmod 0750 "$SNIPPET_DIR" chmod 0750 "$SNIPPET_DIR"