Skip to content

Commit f2c5e74

Browse files
(PE-40377) try to handle missing params
1 parent 3232d17 commit f2c5e74

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/test-migration.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,20 @@ jobs:
109109
echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config
110110
bundle exec rake spec_prep
111111
echo ::endgroup::
112+
primary_host=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) \
113+
new_primary_host=$(yq '.groups[].targets[] | select(.vars.role == "new-primary") | .name' spec/fixtures/litmus_inventory.yaml) \
114+
new_replica_host=$(yq '.groups[].targets[] | select(.vars.role == "new-replica") | .name // empty' spec/fixtures/litmus_inventory.yaml)
115+
new_primary_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "new-primary-pdb-postgresql") | .name // empty' spec/fixtures/litmus_inventory.yaml)
116+
new_replica_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "new-replica-pdb-postgresql") | .name // empty' spec/fixtures/litmus_inventory.yaml)
117+
112118
bundle exec bolt plan run peadm_spec::test_migration \
113119
--inventoryfile spec/fixtures/litmus_inventory.yaml \
114120
--modulepath spec/fixtures/modules \
115-
primary_host=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) \
116-
new_primary_host=$(yq '.groups[].targets[] | select(.vars.role == "new-primary") | .name' spec/fixtures/litmus_inventory.yaml) \
117-
new_replica_host=$(yq '.groups[].targets[] | select(.vars.role == "new-replica") | .name' spec/fixtures/litmus_inventory.yaml) \
118-
new_primary_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "new-primary-pdb-postgresql") | .name' spec/fixtures/litmus_inventory.yaml) \
119-
new_replica_postgresql_host=$(yq '.groups[].targets[] | select(.vars.role == "new-replica-pdb-postgresql") | .name' spec/fixtures/litmus_inventory.yaml) \
121+
primary_host=$primary_host \
122+
new_primary_host=new_primary_host \
123+
${new_replica_host:+new_replica_host=$new_replica_host} \
124+
${new_primary_postgresql_host:+new_primary_postgresql_host=$new_primary_postgresql_host} \
125+
${new_replica_postgresql_host:+new_replica_postgresql_host=$new_replica_postgresql_host} \
120126
upgrade_version=${{ matrix.new_pe_version }} \
121127
--no-host-key-check
122128
- name: Install PE on test cluster

0 commit comments

Comments
 (0)