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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user