Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make monitoring_config enable_components optional #15131

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changelog/8299.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:bug
container: made `monitoring_config.enable_components` optional on `google_container_cluster` (GA)

```
24 changes: 24 additions & 0 deletions google/resource_container_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2405,6 +2405,15 @@ func TestAccContainerCluster_withMonitoringConfig(t *testing.T) {
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"min_master_version"},
},
{
Config: testAccContainerCluster_withMonitoringConfigPrometheusOnly2(clusterName),
},
{
ResourceName: "google_container_cluster.primary",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"min_master_version"},
},
{
Config: testAccContainerCluster_basic(clusterName),
},
Expand Down Expand Up @@ -6421,6 +6430,21 @@ resource "google_container_cluster" "primary" {
`, name)
}

func testAccContainerCluster_withMonitoringConfigPrometheusOnly2(name string) string {
return fmt.Sprintf(`
resource "google_container_cluster" "primary" {
name = "%s"
location = "us-central1-a"
initial_node_count = 1
monitoring_config {
managed_prometheus {
enabled = true
}
}
}
`, name)
}

func testAccContainerCluster_withSoleTenantGroup(name string) string {
return fmt.Sprintf(`
resource "google_compute_node_template" "soletenant-tmpl" {
Expand Down
3 changes: 2 additions & 1 deletion google/services/container/resource_container_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,8 @@ func ResourceContainerCluster() *schema.Resource {
Schema: map[string]*schema.Schema{
"enable_components": {
Type: schema.TypeList,
Required: true,
Optional: true,
Computed: true,
Description: `GKE components exposing metrics. Valid values include SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, and SCHEDULER.`,
Elem: &schema.Schema{
Type: schema.TypeString,
Expand Down