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
|
git pull
|
||||||
|
|
||||||
- name: Deploy controller
|
- name: Deploy controller
|
||||||
run: |
|
run: nomad job run /opt/nomad-csi/csi/controller.nomad
|
||||||
nomad job run /opt/nomad-csi/csi/controller.nomad
|
|
||||||
|
|
||||||
- name: Deploy node plugin
|
- name: Deploy node plugin
|
||||||
run: |
|
run: nomad job run /opt/nomad-csi/csi/node.nomad
|
||||||
nomad job run /opt/nomad-csi/csi/node.nomad
|
|
||||||
|
|
||||||
- name: Verify CSI plugin healthy
|
- name: Verify CSI plugin healthy
|
||||||
run: |
|
run: |
|
||||||
@@ -31,9 +29,8 @@ jobs:
|
|||||||
- name: Provision volumes
|
- name: Provision volumes
|
||||||
run: |
|
run: |
|
||||||
for vol in /opt/nomad-csi/csi/volumes/*.hcl; do
|
for vol in /opt/nomad-csi/csi/volumes/*.hcl; do
|
||||||
# Skip example/template files
|
|
||||||
[[ "$vol" == *example* ]] && continue
|
[[ "$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
|
if nomad volume status "$vol_id" > /dev/null 2>&1; then
|
||||||
echo "Volume $vol_id already exists, skipping"
|
echo "Volume $vol_id already exists, skipping"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user