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

Default tags always generate a diff #1486

Closed
fitz-vivodyne opened this issue Apr 16, 2024 · 1 comment · Fixed by #1571
Closed

Default tags always generate a diff #1486

fitz-vivodyne opened this issue Apr 16, 2024 · 1 comment · Fixed by #1571
Assignees
Labels
impact/reliability Something that feels unreliable or flaky kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@fitz-vivodyne
Copy link

What happened?

I added a couple default tags as enabled by #1369.
Unfortunately, these default tags generate a diff on every preview/apply as it apparently expects the tags to be ordered.

Example

https://github.com/fitz-vivodyne/pulumi-native-tagging-issue.

Every time you run pulumi preview you get a diff due to tag ordering

Previewing update (dev):
  pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:dev::pulumi-native-aws-tagging-issue::pulumi:pulumi:Stack::pulumi-native-aws-tagging-issue-dev]                                               ~ aws-native:s3:Bucket: (update)
        [id=bucket-12f04d5]
        [urn=urn:pulumi:dev::pulumi-native-aws-tagging-issue::aws-native:s3:Bucket::bucket]
      ~ tags: [
          ~ [0]: {
                  ~ key  : "tag1" => "Tag4"
                  ~ value: "a" => "d"
                }
          ~ [1]: {
                  ~ key  : "tag2" => "Tag1"
                  ~ value: "b" => "a"
                }
          ~ [2]: {
                  ~ key  : "tag3" => "Tag2"
                  ~ value: "c" => "b"
                }
          + [3]: {
                  + key  : "Tag3"
                  + value: "c"
                }
        ]
Resources:
    ~ 1 to update
    1 unchanged

Output of pulumi about

CLI
Version 3.108.1
Go Version go1.22.0
Go Compiler gc

Plugins
NAME VERSION
aws-native unknown
yaml unknown

Host
OS darwin
Version 14.3
Arch arm64

This project is written in yaml

Current Stack: organization/pulumi-native-aws-tagging-issue/dev

TYPE URN
pulumi:pulumi:Stack urn:pulumi:dev::pulumi-native-aws-tagging-issue::pulumi:pulumi:Stack::pulumi-native-aws-tagging-issue-dev
pulumi:providers:aws-native urn:pulumi:dev::pulumi-native-aws-tagging-issue::pulumi:providers:aws-native::default
aws-native:s3:Bucket urn:pulumi:dev::pulumi-native-aws-tagging-issue::aws-native:s3:Bucket::bucket

Found no pending operations associated with dev

Backend
Name ip-192-168-50-8.ec2.internal
URL s3://fitz-tissue-viewer-testing?region=us-east-2
User fitz
Organizations
Token type personal

No dependencies found

Pulumi locates its logs in /var/folders/cq/yr41qnrs4rg9363y3yp4f1f40000gn/T/ by default

Additional context

If you disable default tags and tag an item manually it works fine, only fails if default tags are set at the provider level.

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@fitz-vivodyne fitz-vivodyne added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Apr 16, 2024
@t0yv0 t0yv0 added impact/reliability Something that feels unreliable or flaky and removed needs-triage Needs attention from the triage team labels Apr 17, 2024
@t0yv0
Copy link
Member

t0yv0 commented Apr 17, 2024

That sounds very unfortunate, thanks for bringing it to our attention! Will have a look as time permits.

flostadler added a commit that referenced this issue Jun 5, 2024
Previously the default tags where randomly appended to the tag list
because of Go's random iteration order for maps. This introduces sorting
for the key's of the default tags in order to produce deterministic tag
lists and prevent permadiffs.

Fixes #1486
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/reliability Something that feels unreliable or flaky kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants