-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Show diff for computed nested labels fields when creating resources #10401
Show diff for computed nested labels fields when creating resources #10401
Conversation
Tests analyticsTotal tests: Click here to see the affected service packagesall service packages are affected Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccSqlUser_postgresIAM |
|
The failed test is unrelated |
Tests analyticsTotal tests: Click here to see the affected service packagesall service packages are affected Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccSqlUser_postgresIAM |
|
fixes hashicorp/terraform-provider-google#17756
Error
Resource
google_cloud_run_service
andgoogle_cloud_run_domain_mapping
have nested labels fieldsmetadata.0.labels
andmetadata.0.annotations
.In the CustomizeDiff function SetMetadataLabelsDiff,
SetNew
is applied on "metadata" field with the object includingterraform_labels
andeffective_labels
. It introduced two bugs.metadata.0.labels
andmetadata.0.annotations
fields don't appear in terraform planThis bug cannot be fixed with the similar way in Fix the bug for computed labels and annotations #10182.
The reason is that
metadata.0.terraform_labels
andmetadat.0.effective_labels
fields cannot be set to computed due to a bug that SetNew doesn't work on nested fieldsin terraform sdk SetNew does not work on nested fields hashicorp/terraform-plugin-sdk#459
The solution to fix these two bugs in my mind is to move
terraform_labels
andeffective_labels
to root level in provider release 6.0.Before the release 6.0, the first bug can be fixed in this PR and I don't find an easy way to fix the second bug.
Release Note Template for Downstream PRs (will be copied)