Skip to content

Commit

Permalink
Enabling empty value send for fleet default member config in google_g…
Browse files Browse the repository at this point in the history
…ke_hub_feature (#10963)

Co-authored-by: Shuya Ma <[email protected]>
  • Loading branch information
sahsagar-google and shuyama1 authored Jun 19, 2024
1 parent 9a15e62 commit 89adfa7
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
1 change: 1 addition & 0 deletions mmv1/products/gkehub2/Feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
})
}
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion mmv1/third_party/tgc/tests/data/example_gke_hub_feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
"discovery_name": "Feature",
"parent": "//cloudresourcemanager.googleapis.com/projects/{{.Provider.project}}",
"data": {
"fleetDefaultMemberConfig": null,
"labels": {
"foo": "bar"
}
}
},
"ancestors": ["organizations/{{.OrgID}}"]
}
]
]

0 comments on commit 89adfa7

Please sign in to comment.