-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Make dataflow on_delete a virtual field #3567
Conversation
if field == "on_delete" { | ||
continue | ||
} | ||
// Each key within a map must be checked for a change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true for sure? We have other resources with maps that we just do a HasChange on the whole thing for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some digging, turns out that this is just needed for the labels
field due to the resourceDataflowJobLabelDiffSuppress. When we decide to suppress a key, the parent field still reports that it has a change. Terraform plan will show no changes, but d.HasChange("labels") = true
. I ran into this disparity between the labels
parent/keys and incorrectly assumed that it could happen to other maps.
I can't find ways to clear the change during the diff suppress, so I believe the iteration is still needed for labels
. I modified the condition and comments to be specific for the labels
field.
Fixes hashicorp/terraform-provider-google#6301
updating
on_delete
would either cause the batch job to be destroyed or the stream to be updated-by-replacement. To prevent this, we need to check ifon_delete
is our only change by update time.Release Note Template for Downstream PRs (will be copied)