This PR adds a new property infra.gcp.check_availability_zones which would allow skipping the tasks that list GCP availability zones and check if the one we are trying to deploy to exists there.
This is being introduced because listing availability zones may be blocked by organization policies making this task fail.
Also, the original code was listing availability zones unconditionally but was checking if the chosen availability zone is present in that list only if an availability zone was provided (plat__gcp_availability_zones | length > 0). This PR also moves that condition to apply it to the the whole block and not only the last task so listing availability zones is also skipped when no availability zones were chosen.
This was tested by trying to deploy a cluster to an invalid availability zone with infra.gcp.check_availability_zones unset to confirm that it still fails while validating availability zones as before and also trying to deploy a cluster to an invalid availability zone with infra.gcp.check_availability_zones set to true which fails when it tries to deploy the environment to GCP as expected.
This PR adds a new property
infra.gcp.check_availability_zones
which would allow skipping the tasks that list GCP availability zones and check if the one we are trying to deploy to exists there. This is being introduced because listing availability zones may be blocked by organization policies making this task fail.Also, the original code was listing availability zones unconditionally but was checking if the chosen availability zone is present in that list only if an availability zone was provided (
plat__gcp_availability_zones | length > 0
). This PR also moves that condition to apply it to the the whole block and not only the last task so listing availability zones is also skipped when no availability zones were chosen.This was tested by trying to deploy a cluster to an invalid availability zone with
infra.gcp.check_availability_zones
unset to confirm that it still fails while validating availability zones as before and also trying to deploy a cluster to an invalid availability zone withinfra.gcp.check_availability_zones
set totrue
which fails when it tries to deploy the environment to GCP as expected.