fix: use \K grep pattern for volume id extraction

Replace variable-length lookbehind with \K which GNU grep supports.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-05-27 09:50:39 +02:00
parent 0178314810
commit 5acb65abbe

View File

@@ -16,12 +16,10 @@ jobs:
git pull
- name: Deploy controller
run: |
nomad job run /opt/nomad-csi/csi/controller.nomad
run: nomad job run /opt/nomad-csi/csi/controller.nomad
- name: Deploy node plugin
run: |
nomad job run /opt/nomad-csi/csi/node.nomad
run: nomad job run /opt/nomad-csi/csi/node.nomad
- name: Verify CSI plugin healthy
run: |
@@ -31,9 +29,8 @@ jobs:
- name: Provision volumes
run: |
for vol in /opt/nomad-csi/csi/volumes/*.hcl; do
# Skip example/template files
[[ "$vol" == *example* ]] && continue
vol_id=$(grep -Po '(?<=id\s{1,10}=\s{1,10}")[^"]+' "$vol" | head -1)
vol_id=$(grep -oP 'id\s*=\s*"\K[^"]+' "$vol" | head -1)
if nomad volume status "$vol_id" > /dev/null 2>&1; then
echo "Volume $vol_id already exists, skipping"
else