diff --git a/mmv1/products/gkehub2/Feature.yaml b/mmv1/products/gkehub2/Feature.yaml index 33d622d2ee0f..0dd00735c910 100644 --- a/mmv1/products/gkehub2/Feature.yaml +++ b/mmv1/products/gkehub2/Feature.yaml @@ -258,6 +258,7 @@ properties: - !ruby/object:Api::Type::NestedObject name: fleetDefaultMemberConfig description: Optional. Fleet Default Membership Configuration. + send_empty_value: true properties: - !ruby/object:Api::Type::NestedObject name: mesh diff --git a/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_feature_test.go.erb b/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_feature_test.go.erb index faed586ab947..990e5b3f93af 100644 --- a/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_feature_test.go.erb +++ b/mmv1/third_party/terraform/services/gkehub2/resource_gke_hub_feature_test.go.erb @@ -380,6 +380,22 @@ func TestAccGKEHubFeature_FleetDefaultMemberConfigServiceMesh(t *testing.T) { ImportState: true, ImportStateVerify: true, }, + { + Config: testAccGKEHubFeature_FleetDefaultMemberConfigServiceMeshRemovalUpdate(context), + }, + { + ResourceName: "google_gke_hub_feature.feature", + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccGKEHubFeature_FleetDefaultMemberConfigServiceMeshReAddUpdate(context), + }, + { + ResourceName: "google_gke_hub_feature.feature", + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -416,6 +432,33 @@ resource "google_gke_hub_feature" "feature" { `, context) } +func testAccGKEHubFeature_FleetDefaultMemberConfigServiceMeshRemovalUpdate(context map[string]interface{}) string { + return gkeHubFeatureProjectSetupForGA(context) + acctest.Nprintf(` +resource "google_gke_hub_feature" "feature" { + name = "servicemesh" + location = "global" + depends_on = [google_project_service.anthos, google_project_service.gkehub, google_project_service.mesh] + project = google_project.project.project_id +} +`, context) +} + +func testAccGKEHubFeature_FleetDefaultMemberConfigServiceMeshReAddUpdate(context map[string]interface{}) string { + return gkeHubFeatureProjectSetupForGA(context) + acctest.Nprintf(` +resource "google_gke_hub_feature" "feature" { + name = "servicemesh" + location = "global" + fleet_default_member_config { + mesh { + management = "MANAGEMENT_MANUAL" + } + } + depends_on = [google_project_service.anthos, google_project_service.gkehub, google_project_service.mesh] + project = google_project.project.project_id +} +`, context) +} + func TestAccGKEHubFeature_FleetDefaultMemberConfigConfigManagement(t *testing.T) { // VCR fails to handle batched project services acctest.SkipIfVcr(t) diff --git a/mmv1/third_party/tgc/tests/data/example_gke_hub_feature.json b/mmv1/third_party/tgc/tests/data/example_gke_hub_feature.json index 39a22f1c5b26..fc13dafd911b 100644 --- a/mmv1/third_party/tgc/tests/data/example_gke_hub_feature.json +++ b/mmv1/third_party/tgc/tests/data/example_gke_hub_feature.json @@ -9,6 +9,7 @@ "discovery_name": "Feature", "parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}", "data": { + "fleetDefaultMemberConfig": null, "labels": { "foo": "bar" } @@ -16,4 +17,4 @@ }, "ancestors": ["organizations/{{.OrgID}}"] } -] \ No newline at end of file +]