From d13268b418e708aa31fed2c314855f8381ee1b63 Mon Sep 17 00:00:00 2001 From: shumiao Date: Fri, 1 Aug 2025 15:46:36 -0700 Subject: [PATCH 1/2] Update unit test - automated management for the ConfigManagement feature is no longer supported on the api server side. --- google/services/gkehub2/resource_gke_hub_feature_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google/services/gkehub2/resource_gke_hub_feature_test.go b/google/services/gkehub2/resource_gke_hub_feature_test.go index cf93b355767..8d13453b675 100644 --- a/google/services/gkehub2/resource_gke_hub_feature_test.go +++ b/google/services/gkehub2/resource_gke_hub_feature_test.go @@ -483,7 +483,7 @@ resource "google_gke_hub_feature" "feature" { location = "global" fleet_default_member_config { configmanagement { - management = "MANAGEMENT_AUTOMATIC" + management = "MANAGEMENT_MANUAL" config_sync { enabled = true } @@ -559,7 +559,7 @@ resource "google_gke_hub_feature" "feature" { location = "global" fleet_default_member_config { configmanagement { - management = "MANAGEMENT_AUTOMATIC" + management = "MANAGEMENT_MANUAL" config_sync { prevent_drift = true source_format = "unstructured" From 36d8ffb0ab57d22897fbb438d00d8a96e164ad49 Mon Sep 17 00:00:00 2001 From: shumiao Date: Fri, 1 Aug 2025 16:08:26 -0700 Subject: [PATCH 2/2] Update resource_gke_hub_feature_test.go --- .../gkehub2/resource_gke_hub_feature_test.go | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/google/services/gkehub2/resource_gke_hub_feature_test.go b/google/services/gkehub2/resource_gke_hub_feature_test.go index 8d13453b675..975bb13771e 100644 --- a/google/services/gkehub2/resource_gke_hub_feature_test.go +++ b/google/services/gkehub2/resource_gke_hub_feature_test.go @@ -448,14 +448,6 @@ func TestAccGKEHubFeature_FleetDefaultMemberConfigConfigManagement(t *testing.T) ImportState: true, ImportStateVerify: true, }, - { - Config: testAccGKEHubFeature_FleetDefaultMemberConfigConfigManagementEnableAutomaticManagementUpdate(context), - }, - { - ResourceName: "google_gke_hub_feature.feature", - ImportState: true, - ImportStateVerify: true, - }, { Config: testAccGKEHubFeature_FleetDefaultMemberConfigConfigManagementRemovalUpdate(context), }, @@ -464,37 +456,10 @@ func TestAccGKEHubFeature_FleetDefaultMemberConfigConfigManagement(t *testing.T) ImportState: true, ImportStateVerify: true, }, - { - Config: testAccGKEHubFeature_FleetDefaultMemberConfigConfigManagementAutomaticManagement(context), - }, - { - ResourceName: "google_gke_hub_feature.feature", - ImportState: true, - ImportStateVerify: true, - }, }, }) } -func testAccGKEHubFeature_FleetDefaultMemberConfigConfigManagementAutomaticManagement(context map[string]interface{}) string { - return gkeHubFeatureProjectSetupForGA(context) + acctest.Nprintf(` -resource "google_gke_hub_feature" "feature" { - name = "configmanagement" - location = "global" - fleet_default_member_config { - configmanagement { - management = "MANAGEMENT_MANUAL" - config_sync { - enabled = true - } - } - } - depends_on = [google_project_service.anthos, google_project_service.gkehub, google_project_service.acm] - project = google_project.project.project_id -} -`, context) -} - func testAccGKEHubFeature_FleetDefaultMemberConfigConfigManagement(context map[string]interface{}) string { return gkeHubFeatureProjectSetupForGA(context) + acctest.Nprintf(` resource "google_gke_hub_feature" "feature" { @@ -552,33 +517,6 @@ resource "google_gke_hub_feature" "feature" { `, context) } -func testAccGKEHubFeature_FleetDefaultMemberConfigConfigManagementEnableAutomaticManagementUpdate(context map[string]interface{}) string { - return gkeHubFeatureProjectSetupForGA(context) + acctest.Nprintf(` -resource "google_gke_hub_feature" "feature" { - name = "configmanagement" - location = "global" - fleet_default_member_config { - configmanagement { - management = "MANAGEMENT_MANUAL" - config_sync { - prevent_drift = true - source_format = "unstructured" - oci { - sync_repo = "us-central1-docker.pkg.dev/corp-gke-build-artifacts/acm/configs:latest" - policy_dir = "/acm/nonprod-root/" - secret_type = "gcpserviceaccount" - sync_wait_secs = "15" - gcp_service_account_email = "gke-cluster@gke-foo-nonprod.iam.gserviceaccount.com" - } - } - } - } - depends_on = [google_project_service.anthos, google_project_service.gkehub, google_project_service.acm] - project = google_project.project.project_id -} -`, context) -} - func testAccGKEHubFeature_FleetDefaultMemberConfigConfigManagementRemovalUpdate(context map[string]interface{}) string { return gkeHubFeatureProjectSetupForGA(context) + acctest.Nprintf(` resource "google_gke_hub_feature" "feature" {