diff --git a/mmv1/third_party/terraform/services/container/node_config.go.tmpl b/mmv1/third_party/terraform/services/container/node_config.go.tmpl
index b3b67b547484..b83828505784 100644
--- a/mmv1/third_party/terraform/services/container/node_config.go.tmpl
+++ b/mmv1/third_party/terraform/services/container/node_config.go.tmpl
@@ -392,13 +392,13 @@ func schemaNodeConfig() *schema.Schema {
Type: schema.TypeString,
Optional: true,
Computed: true,
- Description: `The name of the image to use for this node.`,
+ Description: `The Operating System image for the node pool. This is a private feature, please contact your Google account team for allowlisting this feature.`,
},
"image_project": {
Type: schema.TypeString,
Optional: true,
Computed: true,
- Description: `The project containing the image to use for this node.`,
+ Description: `The GCP project storing the Operating System image for the node pool. This is a private feature, please contact your Google account team for allowlisting this feature.`,
},
},
},
@@ -4231,7 +4231,7 @@ func nodePoolNodeConfigUpdate(d *schema.ResourceData, config *transport_tpg.Conf
log.Printf("[INFO] Updated labels for node pool %s", name)
}
- if d.HasChange(prefix + "node_config.0.image_type") {
+ if d.HasChange(prefix + "node_config.0.image_type") && !d.HasChange(prefix + "node_config.0.node_image_config") {
req := &container.UpdateClusterRequest{
Update: &container.ClusterUpdate{
DesiredNodePoolId: name,
@@ -4472,6 +4472,9 @@ func nodePoolNodeConfigUpdate(d *schema.ResourceData, config *transport_tpg.Conf
Image: imageConfig.Image,
ImageProject: imageConfig.ImageProject,
}
+ if d.HasChange(prefix + "node_config.0.image_type") {
+ req.ImageType = d.Get(prefix + "node_config.0.image_type").(string)
+ }
updateF := func() error {
clusterNodePoolsUpdateCall := NewClient(config, userAgent).Projects.Locations.Clusters.NodePools.Update(nodePoolInfo.fullyQualifiedName(name), req)
diff --git a/mmv1/third_party/terraform/services/container/resource_container_node_pool_test.go.tmpl b/mmv1/third_party/terraform/services/container/resource_container_node_pool_test.go.tmpl
index 0c1fd85217ec..8abe28f6f592 100644
--- a/mmv1/third_party/terraform/services/container/resource_container_node_pool_test.go.tmpl
+++ b/mmv1/third_party/terraform/services/container/resource_container_node_pool_test.go.tmpl
@@ -1194,6 +1194,14 @@ func TestAccContainerNodePool_withNodeImageConfig(t *testing.T) {
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckContainerClusterDestroyProducer(t),
Steps: []resource.TestStep{
+ {
+ Config: testAccContainerNodePool_withNodeImageConfigBase(cluster, np),
+ },
+ {
+ ResourceName: "google_container_node_pool.with_node_image_config",
+ ImportState: true,
+ ImportStateVerify: true,
+ },
{
Config: testAccContainerNodePool_withNodeImageConfig(cluster, np, "test-cos-images", "test-image-project"),
ExpectError: regexp.MustCompile(`image 'test-cos-images' is not available in project 'test-image-project'`),
@@ -4357,6 +4365,38 @@ resource "google_container_node_pool" "with_windows_node_config" {
`, cluster, np, osversion)
}
+func testAccContainerNodePool_withNodeImageConfigBase(cluster, np string) string {
+ return fmt.Sprintf(`
+data "google_container_engine_versions" "central1a" {
+ location = "us-central1-a"
+}
+
+resource "google_container_cluster" "cluster" {
+ name = "%s"
+ location = "us-central1-a"
+ initial_node_count = 1
+ min_master_version = data.google_container_engine_versions.central1a.latest_master_version
+ deletion_protection = false
+ networking_mode = "VPC_NATIVE"
+ ip_allocation_policy {}
+}
+
+resource "google_container_node_pool" "with_node_image_config" {
+ name = "%s"
+ location = "us-central1-a"
+ cluster = google_container_cluster.cluster.name
+ initial_node_count = 1
+ node_config {
+ image_type = "COS_CONTAINERD"
+ oauth_scopes = [
+ "https://www.googleapis.com/auth/logging.write",
+ "https://www.googleapis.com/auth/monitoring",
+ ]
+ }
+}
+`, cluster, np)
+}
+
func testAccContainerNodePool_withNodeImageConfig(cluster, np, imageName, imageProject string) string {
return fmt.Sprintf(`
data "google_container_engine_versions" "central1a" {
diff --git a/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown b/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown
index b808d4d7e272..59ea1ad7c2e5 100644
--- a/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown
+++ b/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown
@@ -1220,9 +1220,9 @@ sole_tenant_config {
The `node_image_config` block supports:
-* `image` (Optional) - The name of the image to use for this node.
+* `image` (Optional) - The GCP project storing the Operating System image for the node pool. This is a private feature, please contact your Google account team for allowlisting this feature.
-* `image_project` (Optional) - The project containing the image to use for this node.
+* `image_project` (Optional) - The GCP project storing the Operating System image for the node pool. This is a private feature, please contact your Google account team for allowlisting this feature.
The `advanced_machine_features` block supports: