From 7d583179ddd29a2869e5632d0843440f080e0509 Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 16 Sep 2022 15:01:26 -0700 Subject: [PATCH] Fix Monitoring Test (#6554) (#4694) Signed-off-by: Modular Magician Signed-off-by: Modular Magician --- .changelog/6554.txt | 3 + .../resource_container_cluster_test.go | 70 ++++++++++++------- 2 files changed, 49 insertions(+), 24 deletions(-) create mode 100644 .changelog/6554.txt diff --git a/.changelog/6554.txt b/.changelog/6554.txt new file mode 100644 index 0000000000..8ec013c069 --- /dev/null +++ b/.changelog/6554.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` diff --git a/google-beta/resource_container_cluster_test.go b/google-beta/resource_container_cluster_test.go index 0e2679acb2..c2b569e58b 100755 --- a/google-beta/resource_container_cluster_test.go +++ b/google-beta/resource_container_cluster_test.go @@ -2266,61 +2266,68 @@ func TestAccContainerCluster_withMonitoringConfig(t *testing.T) { CheckDestroy: testAccCheckContainerClusterDestroyProducer(t), Steps: []resource.TestStep{ { - Config: testAccContainerCluster_basic(clusterName), + Config: testAccContainerCluster_basic_1_23_8(clusterName), }, { - ResourceName: "google_container_cluster.primary", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"min_master_version"}, }, { Config: testAccContainerCluster_withMonitoringConfigEnabled(clusterName), }, { - ResourceName: "google_container_cluster.primary", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"min_master_version"}, }, { Config: testAccContainerCluster_withMonitoringConfigUpdated(clusterName), }, { - ResourceName: "google_container_cluster.primary", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"min_master_version"}, }, { Config: testAccContainerCluster_withMonitoringConfigPrometheusUpdated(clusterName), }, { - ResourceName: "google_container_cluster.primary", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"min_master_version"}, }, // Back to basic settings to test setting Prometheus on its own { - Config: testAccContainerCluster_basic(clusterName), + Config: testAccContainerCluster_basic_1_23_8(clusterName), }, { - ResourceName: "google_container_cluster.primary", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"min_master_version"}, }, { Config: testAccContainerCluster_withMonitoringConfigPrometheusOnly(clusterName), }, { - ResourceName: "google_container_cluster.primary", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"min_master_version"}, }, { - Config: testAccContainerCluster_basic(clusterName), + Config: testAccContainerCluster_basic_1_23_8(clusterName), }, { - ResourceName: "google_container_cluster.primary", - ImportState: true, - ImportStateVerify: true, + ResourceName: "google_container_cluster.primary", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"min_master_version"}, }, }, }) @@ -6019,12 +6026,24 @@ resource "google_container_cluster" "primary" { `, name) } +func testAccContainerCluster_basic_1_23_8(name string) string { + return fmt.Sprintf(` +resource "google_container_cluster" "primary" { + name = "%s" + location = "us-central1-a" + initial_node_count = 1 + min_master_version = "1.23.8-gke.1900" +} +`, name) +} + func testAccContainerCluster_withMonitoringConfigEnabled(name string) string { return fmt.Sprintf(` resource "google_container_cluster" "primary" { name = "%s" location = "us-central1-a" initial_node_count = 1 + min_master_version = "1.23.8-gke.1900" monitoring_config { enable_components = [ "SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER" ] } @@ -6038,6 +6057,7 @@ resource "google_container_cluster" "primary" { name = "%s" location = "us-central1-a" initial_node_count = 1 + min_master_version = "1.23.8-gke.1900" monitoring_config { enable_components = [ "SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER", "WORKLOADS" ] } @@ -6051,6 +6071,7 @@ resource "google_container_cluster" "primary" { name = "%s" location = "us-central1-a" initial_node_count = 1 + min_master_version = "1.23.8-gke.1900" monitoring_config { enable_components = [ "SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER", "WORKLOADS" ] managed_prometheus { @@ -6067,6 +6088,7 @@ resource "google_container_cluster" "primary" { name = "%s" location = "us-central1-a" initial_node_count = 1 + min_master_version = "1.23.8-gke.1900" monitoring_config { managed_prometheus { enabled = true