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

set master_authorized_networks_config.enabled=true ... #2939

Merged
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
23 changes: 8 additions & 15 deletions third_party/validator/container.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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 {
Expand All @@ -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{})
Expand Down