Skip to content

Fix perma-diff on gpu_driver_installation_config for node_config #18835

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/11152.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
container: fixed perma-diff on `node_config.guest_accelerator.gpu_driver_installation_config` field in GKE 1.30+ in `google_container_node_pool` resource
```
1 change: 1 addition & 0 deletions google/services/container/node_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ func schemaNodeConfig() *schema.Schema {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Computed: true,
ForceNew: true,
ConfigMode: schema.SchemaConfigModeAttr,
Description: `Configuration for auto installation of GPU driver.`,
Expand Down
61 changes: 61 additions & 0 deletions google/services/container/resource_container_node_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4454,3 +4454,64 @@ resource "google_container_node_pool" "np" {
}
`, secretID, cluster, network, subnetwork, nodepool)
}

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

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

acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckContainerNodePoolDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccContainerNodePool_defaultDriverInstallation(cluster, np),
},
{
ResourceName: "google_container_node_pool.np",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func testAccContainerNodePool_defaultDriverInstallation(cluster, np string) string {
return fmt.Sprintf(`
resource "google_container_cluster" "cluster" {
name = "%s"
location = "us-central1-a"
initial_node_count = 3
deletion_protection = false

min_master_version = "1.30.1-gke.1329003"
release_channel {
channel = "RAPID"
}
}

resource "google_container_node_pool" "np" {
name = "%s"
location = "us-central1-a"
cluster = google_container_cluster.cluster.name
initial_node_count = 2
version = "1.30.1-gke.1329003"

node_config {
service_account = "default"
machine_type = "n1-standard-8"

guest_accelerator {
type = "nvidia-tesla-t4"
count = 1
gpu_sharing_config {
gpu_sharing_strategy = "TIME_SHARING"
max_shared_clients_per_gpu = 3
}
}
}
}
`, cluster, np)
}