-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 43: Fix issue with single zone, and update test for the problem. #50
Issue 43: Fix issue with single zone, and update test for the problem. #50
Conversation
@@ -51,7 +51,7 @@ locals { | |||
} | |||
|
|||
cluster_type_output_regional_zones = "${concat(google_container_cluster.primary.*.additional_zones, list(list()))}" | |||
cluster_type_output_zonal_zones = "${concat(google_container_cluster.zonal_primary.*.additional_zones, list(list()))}" | |||
cluster_type_output_zonal_zones = "${concat(slice(var.zones,1,length(var.zones)), list(list()))}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the relevant change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own understanding, is the issue google_container_cluster.zonal_primary.*.additional_zones
sometimes resolves to null instead of a list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own understanding, is the issue google_container_cluster.zonal_primary.*.additional_zones sometimes resolves to null instead of a list?
Ah, I was able to clarify my understanding back in the bug report in #43
Error: Error running plan: 1 error(s) occurred:
* module.gke.local.cluster_type_output_zonal_zones: local.cluster_type_output_zonal_zones: Resource 'google_container_cluster.zonal_primary' does not have attribute 'additional_zones' for variable 'google_container_cluster.zonal_primary.*.additional_zones'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's exactly right. When there's no additional zones, the provider returns null, which breaks that logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we also need to address this?
additional_zones = ["${slice(var.zones,1,length(var.zones))}"] |
examples/single_zone/README.md
Outdated
@@ -0,0 +1,47 @@ | |||
# Simple Zonal Cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of introducing a full new example/fixture, could we just make the simple_zonal example use a single zone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
@morgante That line is fine. Slice returns an empty array, not a null. |
Updated, tests running now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…m-google-kubernetes-engine into issue_43
…netes-engine into issue_43
Issue 43: Fix issue with single zone, and update test for the problem.
No description provided.