From 4186569c732e8a2919166f2a8d319a429add6c1d Mon Sep 17 00:00:00 2001 From: The Magician Date: Wed, 13 Oct 2021 16:49:04 -0700 Subject: [PATCH] Container_cluster: enables GKE workload metrics (#5292) (#3732) Co-authored-by: Scott Suarez Signed-off-by: Modular Magician Co-authored-by: Scott Suarez --- .changelog/5292.txt | 3 +++ google-beta/resource_container_cluster.go | 4 ++-- google-beta/resource_dataproc_cluster_test.go | 3 ++- google-beta/resource_gke_hub_feature_membership_test.go | 2 +- website/docs/r/container_cluster.html.markdown | 3 +-- 5 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 .changelog/5292.txt diff --git a/.changelog/5292.txt b/.changelog/5292.txt new file mode 100644 index 0000000000..227aaad7ef --- /dev/null +++ b/.changelog/5292.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +container_cluster: Updated `monitoring_config` to accept `WORKLOAD` +``` diff --git a/google-beta/resource_container_cluster.go b/google-beta/resource_container_cluster.go index a6aae13c02..c42065498d 100644 --- a/google-beta/resource_container_cluster.go +++ b/google-beta/resource_container_cluster.go @@ -664,10 +664,10 @@ func resourceContainerCluster() *schema.Resource { "enable_components": { Type: schema.TypeList, Required: true, - Description: `GKE components exposing metrics. Valid values include SYSTEM_COMPONENTS.`, + Description: `GKE components exposing metrics. Valid values include SYSTEM_COMPONENTS and WORKLOADS.`, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.StringInSlice([]string{"SYSTEM_COMPONENTS"}, false), + ValidateFunc: validation.StringInSlice([]string{"SYSTEM_COMPONENTS", "WORKLOADS"}, false), }, }, }, diff --git a/google-beta/resource_dataproc_cluster_test.go b/google-beta/resource_dataproc_cluster_test.go index e3c9d32ff6..798461eee3 100644 --- a/google-beta/resource_dataproc_cluster_test.go +++ b/google-beta/resource_dataproc_cluster_test.go @@ -13,8 +13,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - dataproc "google.golang.org/api/dataproc/v1beta2" "google.golang.org/api/googleapi" + + dataproc "google.golang.org/api/dataproc/v1beta2" ) func TestDataprocExtractInitTimeout(t *testing.T) { diff --git a/google-beta/resource_gke_hub_feature_membership_test.go b/google-beta/resource_gke_hub_feature_membership_test.go index 32fa84c196..9e1f2ea64d 100644 --- a/google-beta/resource_gke_hub_feature_membership_test.go +++ b/google-beta/resource_gke_hub_feature_membership_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - dcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl" + "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl" gkehub "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/gkehub/beta" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" diff --git a/website/docs/r/container_cluster.html.markdown b/website/docs/r/container_cluster.html.markdown index 13804819a9..d5e80e4633 100644 --- a/website/docs/r/container_cluster.html.markdown +++ b/website/docs/r/container_cluster.html.markdown @@ -470,8 +470,7 @@ The `logging_config` block supports: The `monitoring_config` block supports: -* `enable_components` - (Required) The GKE components exposing logs. Only `SYSTEM_COMPONENTS` -is supported. +* `enable_components` - (Required) The GKE components exposing logs. `SYSTEM_COMPONENTS` and in beta provider, both `SYSTEM_COMPONENTS` and `WORKLOADS` are supported. The `maintenance_policy` block supports: * `daily_maintenance_window` - (Optional) structure documented below.