-
Notifications
You must be signed in to change notification settings - Fork 263
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
Add support for setting gke intranode visibility #747
Conversation
@chrisst Can you take a look at this PR and merge it if you're happy with it? |
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.
I have a couple quick comments, but overall looks good! No need to address the comments here as I've had to copy this PR into our upstream code generator at GoogleCloudPlatform/magic-modules#1871, so I applied the comments there already.
Once the upstream PR is ready I'll merge this followed by the upstream which will iron out the differences between the two PRs.
@@ -738,6 +744,10 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er | |||
Autoscaling: expandClusterAutoscaling(d.Get("cluster_autoscaling"), d), | |||
MasterAuth: expandMasterAuth(d.Get("master_auth")), | |||
ResourceLabels: expandStringMap(d, "resource_labels"), | |||
NetworkConfig: &containerBeta.NetworkConfig{ | |||
EnableIntraNodeVisibility: d.Get("enable_intranode_visibility").(bool), | |||
ForceSendFields: []string{"Enabled"}, |
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.
I don't think this ForceSendFields is working as intended. There is no Enabled
in the EnableIntraNodeVisibility
object so it is ignored. However since this is in Create and false
is the default there is no need to force send a falsey value.
Since GKE disables Intra Node Visibility by default, this test will ensure that Intra Node Visibility is disabled by default to be | ||
more consistent with default settings in the Cloud Console | ||
*/ | ||
func TestAccContainerCluster_withDefaultIntraNodeVisibility(t *testing.T) { |
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.
Since this field is marked as Default: false
I don't think we need to assert that the default is actually sent to GCP. This is more of a test of Terraform than the provider implementation here. Since GKE tests are somewhat expensive I'll be taking this out.
This PR adds the option to set GKE intranode visibility.
Intranode Visibility is a beta option available on GKE clusters versions >= 1.11 and set to false by default.
Both tests report a pass and I also confirmed the behaviour on the GCP console while the tests were running as well as via the GCP Audit Logs.