diff --git a/.changelog/6189.txt b/.changelog/6189.txt new file mode 100644 index 00000000000..a708a707cd0 --- /dev/null +++ b/.changelog/6189.txt @@ -0,0 +1,3 @@ +```release-note:bug +container: fixed an issue where `node_config.min_cpu_platform` could cause a perma-diff in `google_container_cluster` +``` diff --git a/google/node_config.go b/google/node_config.go index 6a7646dbb77..bd6cbf2b95d 100644 --- a/google/node_config.go +++ b/google/node_config.go @@ -160,6 +160,7 @@ func schemaNodeConfig() *schema.Schema { "min_cpu_platform": { Type: schema.TypeString, Optional: true, + Computed: true, ForceNew: true, Description: `Minimum CPU platform to be used by this instance. The instance may be scheduled on the specified or newer CPU platform.`, }, diff --git a/google/resource_container_cluster_test.go b/google/resource_container_cluster_test.go index 4c10120a203..8f3667b2325 100644 --- a/google/resource_container_cluster_test.go +++ b/google/resource_container_cluster_test.go @@ -182,15 +182,16 @@ func TestAccContainerCluster_withAddons(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"min_master_version"}, }, - { - Config: testAccContainerCluster_withInternalLoadBalancer(pid, clusterName), - }, - { - ResourceName: "google_container_cluster.primary", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"min_master_version"}, - }, + // Issue with cloudrun_config addon: https://github.com/hashicorp/terraform-provider-google/issues/11943 + // { + // Config: testAccContainerCluster_withInternalLoadBalancer(pid, clusterName), + // }, + // { + // ResourceName: "google_container_cluster.primary", + // ImportState: true, + // ImportStateVerify: true, + // ImportStateVerifyIgnore: []string{"min_master_version"}, + // }, }, }) } @@ -2417,7 +2418,9 @@ resource "google_container_cluster" "primary" { enabled = true } cloudrun_config { - disabled = false + # https://github.com/hashicorp/terraform-provider-google/issues/11943 + # disabled = false + disabled = true } dns_cache_config { enabled = true @@ -2427,41 +2430,42 @@ resource "google_container_cluster" "primary" { `, projectID, clusterName) } -func testAccContainerCluster_withInternalLoadBalancer(projectID string, clusterName string) string { - return fmt.Sprintf(` -data "google_project" "project" { - project_id = "%s" -} - -resource "google_container_cluster" "primary" { - name = "%s" - location = "us-central1-a" - initial_node_count = 1 - - min_master_version = "latest" - - workload_identity_config { - workload_pool = "${data.google_project.project.project_id}.svc.id.goog" - } - - addons_config { - http_load_balancing { - disabled = false - } - horizontal_pod_autoscaling { - disabled = false - } - network_policy_config { - disabled = false - } - cloudrun_config { - disabled = false - load_balancer_type = "LOAD_BALANCER_TYPE_INTERNAL" - } - } -} -`, projectID, clusterName) -} +// Issue with cloudrun_config addon: https://github.com/hashicorp/terraform-provider-google/issues/11943/ +// func testAccContainerCluster_withInternalLoadBalancer(projectID string, clusterName string) string { +// return fmt.Sprintf(` +// data "google_project" "project" { +// project_id = "%s" +// } + +// resource "google_container_cluster" "primary" { +// name = "%s" +// location = "us-central1-a" +// initial_node_count = 1 + +// min_master_version = "latest" + +// workload_identity_config { +// workload_pool = "${data.google_project.project.project_id}.svc.id.goog" +// } + +// addons_config { +// http_load_balancing { +// disabled = false +// } +// horizontal_pod_autoscaling { +// disabled = false +// } +// network_policy_config { +// disabled = false +// } +// cloudrun_config { +// disabled = false +// load_balancer_type = "LOAD_BALANCER_TYPE_INTERNAL" +// } +// } +// } +// `, projectID, clusterName) +// } func testAccContainerCluster_withNotificationConfig(clusterName string, topic string) string { return fmt.Sprintf(`