Skip to content
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

Allow configuring node_config of node_pools specified in container_cluster #299

Merged
merged 2 commits into from
Aug 11, 2017

Conversation

drebes
Copy link
Contributor

@drebes drebes commented Aug 5, 2017

With this, node pools can be configured when defined explicitly in the google_container_cluster resource:

resource "google_container_cluster" "cluster-1" {
  name = "cluster-1"
  zone = "us-central1-a"

  additional_zones = [
    "us-central1-b",
    "us-central1-c",
  ]

  node_pool {
    name               = "frontend"
    initial_node_count = 1

    node_config {
      machine_type    = "n1-standard-1"
      disk_size_gb    = 10
    }
  }
}

Acceptance tests:

$ make testacc TEST=./google TESTARGS='-run=TestAccContainerCluster_withNodePool'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./google -v -run=TestAccContainerCluster_withNodePool -timeout 120m
=== RUN   TestAccContainerCluster_withNodePoolBasic
--- PASS: TestAccContainerCluster_withNodePoolBasic (272.71s)
=== RUN   TestAccContainerCluster_withNodePoolNamePrefix
--- PASS: TestAccContainerCluster_withNodePoolNamePrefix (258.92s)
=== RUN   TestAccContainerCluster_withNodePoolMultiple
--- PASS: TestAccContainerCluster_withNodePoolMultiple (270.73s)
=== RUN   TestAccContainerCluster_withNodePoolConflictingNameFields
--- PASS: TestAccContainerCluster_withNodePoolConflictingNameFields (0.02s)
=== RUN   TestAccContainerCluster_withNodePoolNodeConfig
--- PASS: TestAccContainerCluster_withNodePoolNodeConfig (290.51s)
PASS
ok  	github.com/terraform-providers/terraform-provider-google/google	1092.914s
$ make testacc TEST=./google TESTARGS='-run=TestAccContainerCluster_withNodeConfig'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./google -v -run=TestAccContainerCluster_withNodeConfig -timeout 120m
=== RUN   TestAccContainerCluster_withNodeConfig
--- PASS: TestAccContainerCluster_withNodeConfig (323.94s)
=== RUN   TestAccContainerCluster_withNodeConfigScopeAlias
--- PASS: TestAccContainerCluster_withNodeConfigScopeAlias (300.19s)
PASS
ok  	github.com/terraform-providers/terraform-provider-google/google	624.152s

I've also changed google_container_node_pool to use the same node_config parsing:

$ make testacc TEST=./google TESTARGS='-run=TestAccContainerNodePool_withNodeConfig'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./google -v -run=TestAccContainerNodePool_withNodeConfig -timeout 120m
=== RUN   TestAccContainerNodePool_withNodeConfig
--- PASS: TestAccContainerNodePool_withNodeConfig (522.87s)
=== RUN   TestAccContainerNodePool_withNodeConfigScopeAlias
--- PASS: TestAccContainerNodePool_withNodeConfigScopeAlias (540.10s)
PASS
ok  	github.com/terraform-providers/terraform-provider-google/google	1062.994s

@rosbo rosbo requested review from rosbo and removed request for rosbo August 7, 2017 17:55
@drebes drebes force-pushed the gke_nodepool_nodeconfig branch 2 times, most recently from a3d48ce to c236728 Compare August 9, 2017 21:18
Copy link
Contributor

@danawillow danawillow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ make testacc TEST=./google TESTARGS='-run=TestAccContainerCluster_withNodePoolNodeConfig'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./google -v -run=TestAccContainerCluster_withNodePoolNodeConfig -timeout 120m
=== RUN   TestAccContainerCluster_withNodePoolNodeConfig
--- PASS: TestAccContainerCluster_withNodePoolNodeConfig (305.71s)
PASS

@@ -103,3 +104,68 @@ var schemaNodeConfig = &schema.Schema{
},
},
}

func fillNodeConfig(v interface{}) *container.NodeConfig {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you call this expandNodeConfig to match this sort of function in other resources?

@drebes drebes force-pushed the gke_nodepool_nodeconfig branch from c236728 to 77265f4 Compare August 11, 2017 18:32
@drebes drebes force-pushed the gke_nodepool_nodeconfig branch from 544c889 to 2aaf64c Compare August 11, 2017 18:38
@danawillow
Copy link
Contributor

Thanks!

@danawillow danawillow merged commit 5602218 into hashicorp:master Aug 11, 2017
z1nkum pushed a commit to z1nkum/terraform-provider-google that referenced this pull request Aug 15, 2017
negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this pull request May 21, 2019
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants