-
Notifications
You must be signed in to change notification settings - Fork 155
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
Removing default tags fails to untag resources on v6 #2633
Comments
- Add more feedback to what we're doing and why. - Explain how the default tags are applied by the bridge. - Disable step 5 of the test until we resolve #2633
Example of original failure: https://github.com/pulumi/pulumi-aws/actions/runs/5602049680/job/15176971731#step:23:115 |
@t0yv0 I assigned to you since you were looking at it yesterday - please let me know if you don't have time to continue |
I can reproduce this issue locally on the latest v6 branch. I have been digging into this issue. The issue appears to be an incorrect resource Diff when moving from a state that defines some provider-default tags to a state where the state defines no provider-default tags. Adding or removing some but not all default tags, or changing tags works as expected. |
When this feature does work, we get a non-empty InstanceDiff; the fix for default tags looked at how we used to suppress non-empty diffs for computed attributes and we stopped doing that for XComputedInput to make an exception for tags_all. However in this case that's not happening at all, we even don't get to this call site:
|
I'm removing flaky/test labels AFAIK this is a legit product bug. |
On second thought, when this does work, like adding a new tag, we also copy |
|
One laborious, but possible avenue of investigation is this. Does this example work when executed via TF CLI in TF world? If it does work, does that end up invoking SetTagsDiff, or how does it ensure the end result? |
Before we look at TF directly - Do I remember correctly that this test works in 5.x of our provider? If so, do we know what changed? |
@t0yv0 The example does work in the TF world. I confirmed that before investing too much time in fixing the bug on our end. @mikhailshilkov hashicorp/terraform-provider-aws#30793 changed how |
I've been experimenting with running terraform-provider-aws directly against TF. I've been using this program: provider "aws" {
region = "us-east-1"
- default_tags { tags = { "foo": "bar" } }
+ # default_tags { tags = { "foo": "bar" } }
}
resource "aws_s3_bucket" "example" {} This calls into This is different to how Investigating further, we don't appear to set Running this program against v5 or v6 of name: secret-random-yaml
runtime: yaml
resources:
p:
type: pulumi:providers:aws
properties:
defaultTags:
tags:
foo: buz
region: us-west-2
defaultProvider: true
b:
type: aws:s3:BucketV2
outputs:
tags: ${b.tags} We get an empty 𝛌 pulumi stack output tags
{} |
Excellent sleuthing. This is very surprising and violates my mental model of what's happening. I thought that in the listed TF program "tags" is in fact not changing. I assume "tags" refers to the tags attribute of "example" bucket, not the provider. Do you have a test harness around to reproduce this result? Tracing the contents of |
More digging makes it even less cut and dry. Given the above program, the initial
However, running
Commenting out
|
Another interesting note, where
And then leads to this diff:
If we run
|
Running |
Closed by #2655 |
The final step (5) in the test
TestAccDefaultTagsGo
is currently failing in CI but passes locally.We're disabling the test temporarily to unblock the release but should diagnose the failure as a matter of urgency post-release.
Step 5 is asserting that when all default tags are removed from the provider, then they're also removed from all resources. This fails and the previous default tags remain on the resources.
The text was updated successfully, but these errors were encountered: