Skip to content

Commit 70e8296

Browse files
committed
fix(workflow): update yq queries to use .name instead of .uri
- Modify yq queries to select .name instead of .uri for primary and compiler roles - Ensure correct identification of primary and compiler nodes in the inventory
1 parent aca3a05 commit 70e8296

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/test-upgrade-legacy.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ jobs:
112112
- name: Convert one compiler to legacy
113113
timeout-minutes: 120
114114
run: |
115-
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml)
116-
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .uri' spec/fixtures/litmus_inventory.yaml | head -n 1)
115+
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
116+
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
117117
echo ::group::convert_compiler_to_legacy
118118
bundle exec bolt plan run peadm::convert_compiler_to_legacy \
119119
--inventoryfile spec/fixtures/litmus_inventory.yaml \
@@ -126,8 +126,8 @@ jobs:
126126
- name: Check if compiler is converted
127127
timeout-minutes: 120
128128
run: |
129-
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml)
130-
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .uri' spec/fixtures/litmus_inventory.yaml | head -n 1)
129+
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
130+
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
131131
legacy_compiler=$(yq '.items[0].value.params.legacy_compilers[0]' bolt task run peadm::get_peadm_config -t $primary --no-host-key-check --format json)
132132
if [ "$compiler" != "$legacy_compiler" ]; then
133133
echo "Compiler conversion failed"

0 commit comments

Comments
 (0)