Skip to content

Commit 6be2fb7

Browse files
Fix perma-diff on gpu_driver_installation_config for node_config (#11152) (#18835)
[upstream:175fd710586d855bdede46688edf5a07db6715a4] Signed-off-by: Modular Magician <[email protected]>
1 parent 056a904 commit 6be2fb7

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

.changelog/11152.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
container: fixed perma-diff on `node_config.guest_accelerator.gpu_driver_installation_config` field in GKE 1.30+ in `google_container_node_pool` resource
3+
```

google/services/container/node_config.go

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ func schemaNodeConfig() *schema.Schema {
155155
Type: schema.TypeList,
156156
MaxItems: 1,
157157
Optional: true,
158+
Computed: true,
158159
ForceNew: true,
159160
ConfigMode: schema.SchemaConfigModeAttr,
160161
Description: `Configuration for auto installation of GPU driver.`,

google/services/container/resource_container_node_pool_test.go

+61
Original file line numberDiff line numberDiff line change
@@ -4454,3 +4454,64 @@ resource "google_container_node_pool" "np" {
44544454
}
44554455
`, secretID, cluster, network, subnetwork, nodepool)
44564456
}
4457+
4458+
func TestAccContainerNodePool_defaultDriverInstallation(t *testing.T) {
4459+
t.Parallel()
4460+
4461+
cluster := fmt.Sprintf("tf-test-cluster-%s", acctest.RandString(t, 10))
4462+
np := fmt.Sprintf("tf-test-nodepool-%s", acctest.RandString(t, 10))
4463+
4464+
acctest.VcrTest(t, resource.TestCase{
4465+
PreCheck: func() { acctest.AccTestPreCheck(t) },
4466+
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
4467+
CheckDestroy: testAccCheckContainerNodePoolDestroyProducer(t),
4468+
Steps: []resource.TestStep{
4469+
{
4470+
Config: testAccContainerNodePool_defaultDriverInstallation(cluster, np),
4471+
},
4472+
{
4473+
ResourceName: "google_container_node_pool.np",
4474+
ImportState: true,
4475+
ImportStateVerify: true,
4476+
},
4477+
},
4478+
})
4479+
}
4480+
4481+
func testAccContainerNodePool_defaultDriverInstallation(cluster, np string) string {
4482+
return fmt.Sprintf(`
4483+
resource "google_container_cluster" "cluster" {
4484+
name = "%s"
4485+
location = "us-central1-a"
4486+
initial_node_count = 3
4487+
deletion_protection = false
4488+
4489+
min_master_version = "1.30.1-gke.1329003"
4490+
release_channel {
4491+
channel = "RAPID"
4492+
}
4493+
}
4494+
4495+
resource "google_container_node_pool" "np" {
4496+
name = "%s"
4497+
location = "us-central1-a"
4498+
cluster = google_container_cluster.cluster.name
4499+
initial_node_count = 2
4500+
version = "1.30.1-gke.1329003"
4501+
4502+
node_config {
4503+
service_account = "default"
4504+
machine_type = "n1-standard-8"
4505+
4506+
guest_accelerator {
4507+
type = "nvidia-tesla-t4"
4508+
count = 1
4509+
gpu_sharing_config {
4510+
gpu_sharing_strategy = "TIME_SHARING"
4511+
max_shared_clients_per_gpu = 3
4512+
}
4513+
}
4514+
}
4515+
}
4516+
`, cluster, np)
4517+
}

0 commit comments

Comments
 (0)