Skip to content

Commit

Permalink
fix(workflow): update yq queries to use .name instead of .uri
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
CoMfUcIoS committed Sep 19, 2024
1 parent aca3a05 commit 70e8296
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test-upgrade-legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ jobs:
- name: Convert one compiler to legacy
timeout-minutes: 120
run: |
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml)
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .uri' spec/fixtures/litmus_inventory.yaml | head -n 1)
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
echo ::group::convert_compiler_to_legacy
bundle exec bolt plan run peadm::convert_compiler_to_legacy \
--inventoryfile spec/fixtures/litmus_inventory.yaml \
Expand All @@ -126,8 +126,8 @@ jobs:
- name: Check if compiler is converted
timeout-minutes: 120
run: |
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .uri' spec/fixtures/litmus_inventory.yaml)
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .uri' spec/fixtures/litmus_inventory.yaml | head -n 1)
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
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)
if [ "$compiler" != "$legacy_compiler" ]; then
echo "Compiler conversion failed"
Expand Down

0 comments on commit 70e8296

Please sign in to comment.