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

enable_shielded_nodes is not sent for container cluster resource #9118

Closed
ScottSuarez opened this issue May 10, 2021 · 2 comments · Fixed by GoogleCloudPlatform/magic-modules#4774, hashicorp/terraform-provider-google-beta#3247 or #9131
Labels

Comments

@ScottSuarez
Copy link
Collaborator

When you specify enable_shielded_nodes on container cluster resource the value isn't being sent.

References

  • b/187748032
@ScottSuarez
Copy link
Collaborator Author

terraform sdk has this thing where if a field is computed it wont't tell you if it exists in the config with getOk if the underlying value is falsey.. This seems like a problem where we rely on this behavior.
https://github.com/hashicorp/terraform-plugin-sdk/blob/main/helper/schema/resource_data.go#L85

ie b/187748032 runs into this issue because it tries to read if enable_shielded_nodes exists in the config first, but since the resource is computed and falsey it is never showing up.
https://github.com/hashicorp/terraform-provider-google-beta/blob/master/google-beta/resource_container_cluster.go#L1370

	if v, ok := d.GetOk("enable_shielded_nodes"); ok {

ok will always be false if computed is true and the value is falsey.

https://github.com/hashicorp/terraform-plugin-sdk/blame/main/helper/schema/resource_data.go#L94

so in this case terraform pretends that the value doesn't exist in the config.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.