-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for the management field in ConfigManagement Fleet-level …
…default config (#11291) (#18963) [upstream:fcb51889011bfd782ee5127815ef6635c35eef80] Signed-off-by: Modular Magician <[email protected]>
- Loading branch information
1 parent
7a12ffc
commit 60a1a4b
Showing
4 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:enhancement | ||
gkehub: added `management` field to ConfigManagement `fleet_default_member_config` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -434,10 +434,53 @@ 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), | ||
}, | ||
{ | ||
ResourceName: "google_gke_hub_feature.feature", | ||
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_AUTOMATIC" | ||
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" { | ||
|
@@ -473,6 +516,7 @@ resource "google_gke_hub_feature" "feature" { | |
fleet_default_member_config { | ||
configmanagement { | ||
version = "1.16.1" | ||
management = "MANAGEMENT_MANUAL" | ||
config_sync { | ||
enabled = true | ||
prevent_drift = true | ||
|
@@ -493,6 +537,45 @@ 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 { | ||
version = "1.16.1" | ||
management = "MANAGEMENT_AUTOMATIC" | ||
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 = "[email protected]" | ||
} | ||
} | ||
} | ||
} | ||
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" { | ||
name = "configmanagement" | ||
location = "global" | ||
depends_on = [google_project_service.anthos, google_project_service.gkehub, google_project_service.acm] | ||
project = google_project.project.project_id | ||
} | ||
`, context) | ||
} | ||
|
||
func TestAccGKEHubFeature_Clusterupgrade(t *testing.T) { | ||
// VCR fails to handle batched project services | ||
acctest.SkipIfVcr(t) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters