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

StackTag: Updating stack tag name throws an error #169

Closed
MitchellGerdisch opened this issue Sep 13, 2023 · 0 comments · Fixed by #206
Closed

StackTag: Updating stack tag name throws an error #169

MitchellGerdisch opened this issue Sep 13, 2023 · 0 comments · Fixed by #206
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@MitchellGerdisch
Copy link

What happened?

Using the code sample below, do the following:

  • pulumi up
  • Modify code to comment out one of the name= lines and uncomment the other (i.e. change the name field of the tag)
  • pulumi up
    • This will trigger an update
  • You will see an error (example provided below) about not being able to find the tag with the NEW name. So it's trying to update the tag based on the new name and not realizing it needs to update the resource based on the old name first - probably should be a replace?
  • NOTE: using delete_before_replace or delete_on_changes does not help

CODE:

stacktag = pulumicloud.StackTag("my-stack-tag",
  organization=pulumi.get_organization(),
  project=pulumi.get_project(),
  stack=pulumi.get_stack(),
  name="goo",
  # name="foo",
  value="moo",
) 

ERROR after changing name from goo to foo

  pulumiservice:index:StackTag (my-stack-tag):
    error: failed to make request: 404 API error: Not Found: Stack Tag 'foo' not found

Expected Behavior

Changing the name of the tag should be processed correctly.
Probably should at least drive a replacement event.

Steps to reproduce

See notes above.

Output of pulumi about

CLI
Version 3.80.0
Go Version go1.21.0
Go Compiler gc

Plugins
NAME VERSION
pulumiservice 0.13.0
python unknown

Host
OS darwin
Version 13.5
Arch x86_64

This project is written in python: executable='/Users/mitch/Downloads/stacktag-test/venv/bin/python3' version='3.11.3
'

Current Stack: MitchGerdisch/stacktag-test/dev

TYPE URN
pulumi:pulumi:Stack urn:pulumi:dev::stacktag-test::pulumi:pulumi:Stack::stacktag-test-dev
pulumi:providers:pulumiservice urn:pulumi:dev::stacktag-test::pulumi:providers:pulumiservice::default_0_13_0
pulumiservice:index:StackTag urn:pulumi:dev::stacktag-test::pulumiservice:index:StackTag::my-stack-tag

Found no pending operations associated with dev

Backend
Name pulumi.com
URL https://app.pulumi.com/xxxxxx

Dependencies:
NAME VERSION
pip 23.2.1
pulumi-pulumiservice 0.13.0
setuptools 68.2.2
wheel 0.41.2

Additional context

No response

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).

@MitchellGerdisch MitchellGerdisch added the kind/bug Some behavior is incorrect or out of spec label Sep 13, 2023
@komalali komalali self-assigned this Dec 14, 2023
@komalali komalali added this to the 0.98 milestone Dec 14, 2023
komalali added a commit that referenced this issue Dec 18, 2023
Stack tags don't really need to be updated since they're not stateful.
We can always just replace the tag, with a delete before replace. This
ensures that it's always `Create` that is called, rather than `Update`.
This keeps things simple and avoids potential bugs in the Update code,
of which there have been multiple. [Exhibit
A](#75) [Exhibit
B](#86)

Fixes #169
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants