-
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
Enable specifying master_authorized_networks_config #10
Enable specifying master_authorized_networks_config #10
Conversation
e0ac559
to
8037d88
Compare
Not sure if testing described in the README is expected to work; this is what I get on my machine
|
The |
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.
Looking good, but currently failing on:
-----> Starting Kitchen (v1.23.2)
$$$$$$ Running command `terraform version`
Terraform v0.11.8
+ provider.google (unversioned)
+ provider.kubernetes v1.2.0
+ provider.null v1.0.0
$$$$$$ Terraform v0.11.8 is supported
-----> Converging <default-local>...
$$$$$$ Running command `terraform workspace select kitchen-terraform-default-local`
$$$$$$ Running command `terraform get -update /Users/ryankoch/Git/github/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/tmp/regional`
- module.gke
Updating source "../../../../"
$$$$$$ Running command `terraform validate -check-variables=true /Users/ryankoch/Git/github/terraform-google-modules/terraform-google-kubernetes-engine/test/integration/tmp/regional`
Error: module.gke.output.master_authorized_networks_config: local.master_authorized_networks_config: no local value of this name has been declared
Error: module.gke.local.cluster_master_authorized_networks_config: local.cluster_master_authorized_networks_config: local.cluster_type_output_cluster_master_authorized_networks_config: no local value of this name has been declared
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.
Thanks so much for the PR. Let's just make sure tests pass and this can get merged in.
outputs.tf
Outdated
@@ -50,6 +50,11 @@ output "min_master_version" { | |||
value = "${local.cluster_min_master_version}" | |||
} | |||
|
|||
output "master_authorized_networks_config" { | |||
description = "Networks from which access to master is permitted" | |||
value = "${local.master_authorized_networks_config}" |
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.
@pratikmallya Looks like this references the wrong value. Think you meant to reference this: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/pull/10/files#diff-7a370d8342e7203b805911c92454f0f4R76
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.
Ah, thanks @morgante ! Fixed
8037d88
to
0d214aa
Compare
@ryanckoch there was a typo which has been fixed. Could you take a look? |
e789827
to
c0b223a
Compare
Looking good, just currently hitting the following when
This is a similar issue to what we've seen in on another module: terraform-google-modules/terraform-google-network#5 This seems to be caused by the provider ignoring the empty The best way we've come up to get around this in this case, is just pass the variable to the output. Would also in this case negate the need to set the |
Updated |
Could we add a test for this to the integration tests? |
365c6fe
to
03091f4
Compare
I'll need some help setting up the test locally. I get this:
|
Tests are all passing now with |
Do |
@ryanckoch Can we integration test setup directions to the readme? |
There is a sample, it just needs documented a bit better. |
I tackled this a little while ago and found the formatting required for the variable to be a bit tricky (at least, how I got it to work), so I ended up including a full example in my variable description to help users.
|
@qvallance I like the idea of being more explicit; this is kinda of a downstream module though (the variable is a pass-through input to the google_container_cluster module) so I'm not sure if we want to be that descriptive. |
@pratikmallya I generally agree that downstream variables don’t need to be that descriptive. I just found the required pass through format for this particularly variable not obvious from the documentation. |
Ah, I see what you're saying. It doesn't match what the original variable looks like.... thanks @qvallance ! |
Need more help trying to run the tests locally. Stuck on this issue with the terraform driver now:
Even though I do have terraform installed. Ideas on how to fix this? |
03091f4
to
368dc4d
Compare
@morgante without giving clear instructions on how to run the integration tests, its hard for me to make the changes that you have requested. I'm unfortunately not very familiar with ruby/chef/kitchen and have not been able to figure how to fix this error |
variables.tf
Outdated
@@ -65,6 +65,12 @@ variable "node_version" { | |||
default = "" | |||
} | |||
|
|||
variable "master_authorized_networks_config" { | |||
description = "The desired configuration options for master authorized networks. Omit the nested cidr_blocks attribute to disallow external access (except the cluster node IPs, which GKE automatically whitelists)." |
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.
@pratikmallya Could we expand this to include an example config, like here: #10 (comment)
@pratikmallya Understood, I'm okay with merging this without tests assuming our existing tests pass. If you address this final comment we can merge: #10 (review) Thanks for your work on this and patience. |
Many thanks to @qvallance for this tip!
94c55c7
to
5fd3e12
Compare
@morgante @ryanckoch updated the variable description |
@morgante ping |
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
…master_auth_network Enable specifying master_authorized_networks_config
Fixes #7