Skip to content

Commit

Permalink
[GKE Hub]: Add test step without a default cluster config
Browse files Browse the repository at this point in the history
  • Loading branch information
sandmman committed Dec 1, 2023
1 parent fc0c99e commit 6d957c8
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ func TestAccGKEHub2Fleet_gkehubFleetBasicExample_update(t *testing.T) {
ImportState: true,
ImportStateVerify: true,
},
{
Config: testAccGKEHub2Fleet_removedDefaultClusterConfig(context),
},
{
ResourceName: "google_gke_hub_fleet.default",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
Expand Down Expand Up @@ -93,6 +101,17 @@ resource "google_gke_hub_fleet" "default" {
`, context)
}

func testAccGKEHub2Fleet_removedDefaultClusterConfig(context map[string]interface{}) string {
return gkeHubFleetProjectSetupForGA(context) + acctest.Nprintf(`
resource "google_gke_hub_fleet" "default" {
project = google_project.project.project_id
display_name = "my updated fleet"

depends_on = [time_sleep.wait_for_gkehub_enablement]
}
`, context)
}

func gkeHubFleetProjectSetupForGA(context map[string]interface{}) string {
return acctest.Nprintf(`
resource "google_project" "project" {
Expand Down

0 comments on commit 6d957c8

Please sign in to comment.