From 2da84c496514cbe9be9dcd5ae408abff1a45b00b Mon Sep 17 00:00:00 2001 From: Albert Yu Date: Wed, 8 Jan 2020 18:04:52 +0000 Subject: [PATCH] set master_authorized_networks_config.enabled=true ... Signed-off-by: Modular Magician --- google/container.go | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/google/container.go b/google/container.go index 943123878..e8b5129d7 100644 --- a/google/container.go +++ b/google/container.go @@ -1,13 +1,13 @@ -// This file is written manually and is not based from terraform-provider-google. -// There is a huge potential for drift. The longer term plan is to have this -// file generated from the logic in terraform-provider-google. Please -// see https://github.com/GoogleCloudPlatform/magic-modules/pull/2485#issuecomment-545680059 +// This file is written manually and is not based from terraform-provider-google. +// There is a huge potential for drift. The longer term plan is to have this +// file generated from the logic in terraform-provider-google. Please +// see https://github.com/GoogleCloudPlatform/magic-modules/pull/2485#issuecomment-545680059 // for the discussion. package google import ( - "fmt" + "fmt" "reflect" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" @@ -1100,12 +1100,9 @@ func expandContainerClusterMasterAuthorizedNetworksConfig(v interface{}, d Terra original := raw.(map[string]interface{}) transformed := make(map[string]interface{}) - transformedEnabled, err := expandContainerClusterMasterAuthorizedNetworksConfigEnabled(original["enabled"], d, config) - if err != nil { - return nil, err - } else if val := reflect.ValueOf(transformedEnabled); val.IsValid() && !isEmptyValue(val) { - transformed["enabled"] = transformedEnabled - } + // enabled is always true as long as there is a master_authorized_networks_config config block. + // There is no option in Terraform to disable that when master_authorized_networks_config is seen. + transformed["enabled"] = true transformedCidrBlocks, err := expandContainerClusterMasterAuthorizedNetworksConfigCidrBlocks(original["cidr_blocks"], d, config) if err != nil { @@ -1117,10 +1114,6 @@ func expandContainerClusterMasterAuthorizedNetworksConfig(v interface{}, d Terra return transformed, nil } -func expandContainerClusterMasterAuthorizedNetworksConfigEnabled(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { - return v, nil -} - func expandContainerClusterMasterAuthorizedNetworksConfigCidrBlocks(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) { v = v.(*schema.Set).List() l := v.([]interface{})