Skip to content

Commit

Permalink
container_node_pool : add gvnic support (GoogleCloudPlatform#5789)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottSuarez authored and lcaggio committed Mar 18, 2022
1 parent c453252 commit 0fd2dda
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,55 @@ resource "google_container_node_pool" "np" {
`, cluster, np)
}

func TestAccContainerNodePool_gvnic(t *testing.T) {
t.Parallel()

cluster := fmt.Sprintf("tf-test-cluster-%s", randString(t, 10))
np := fmt.Sprintf("tf-test-nodepool-%s", randString(t, 10))

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckContainerNodePoolDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccContainerNodePool_gvnic(cluster, np),
},
{
ResourceName: "google_container_node_pool.np",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccContainerNodePool_gvnic(cluster, np string) string {
return fmt.Sprintf(`
resource "google_container_cluster" "cluster" {
name = "%s"
location = "us-central1-a"
initial_node_count = 1
min_master_version = "1.19"
}

resource "google_container_node_pool" "np" {
name = "%s"
location = "us-central1-a"
cluster = google_container_cluster.cluster.name
initial_node_count = 1

node_config {
machine_type = "n1-standard-8"
image_type = "COS_CONTAINERD"
gvnic {
enabled = true
}
}
}
`, cluster, np)
}

<% unless version == 'ga' -%>
func TestAccContainerNodePool_compactPlacement(t *testing.T) {
t.Parallel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ subnetwork in which the cluster's instances are launched.
It can only be disabled if the nodes already do not have network policies enabled.
Defaults to disabled; set `disabled = false` to enable.

* `gcp_filestore_csi_driver_config` - (Optional) The status of the Filestore CSI driver addon,
* `gcp_filestore_csi_driver_config` - (Optional) The status of the Filestore CSI driver addon,
which allows the usage of filestore instance as volumes.
It is disbaled by default; set `enabled = true` to enable.

Expand Down

0 comments on commit 0fd2dda

Please sign in to comment.