fix Proxmox snippet storage detection
Kube-bench CIS scan / Scan ephemeral K3s cluster (push) Failing after 3m28s
Kube-bench CIS scan / Scan ephemeral K3s cluster (push) Failing after 3m28s
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user