Allow skipping GCP availability zones validation. #150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.