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

Change parent of resource will lead to AlreadyExists problem #8589

Closed
liubog2008 opened this issue Dec 13, 2021 · 6 comments
Closed

Change parent of resource will lead to AlreadyExists problem #8589

liubog2008 opened this issue Dec 13, 2021 · 6 comments
Labels
kind/question Questions about existing features resolution/fixed This issue was fixed

Comments

@liubog2008
Copy link

Hello!

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

Issue details

Steps to reproduce

  1. Deploy ns nnn.
  2. Deploy configmap nnn/xxx without parent nnn.
  3. Change configmap nnn/xxx parent to nnn.
  4. Fail to deploy configmap because nnn/xxx already exists.

Expected:

Success to deploy configmap again in step 4.

Actual:

Have to recover manually.

@mikhailshilkov mikhailshilkov transferred this issue from pulumi/pulumi-kubernetes Dec 14, 2021
@mikhailshilkov
Copy link
Member

I moved the issue to pulumi/pulumi because I think it's not kubernetes-specific.

@mikhailshilkov mikhailshilkov added the needs-triage Needs attention from the triage team label Dec 14, 2021
@leezen leezen removed the needs-triage Needs attention from the triage team label Dec 14, 2021
@leezen
Copy link
Contributor

leezen commented Dec 14, 2021

@liubog2008 When you re-parented the ConfigMap, did you specify its alias when doing so? (see https://www.pulumi.com/blog/cumundi-guest-post/#find-relationships-between-resources for an example of doing this).

@liubog2008
Copy link
Author

No, I just add a parent.

@leezen
Copy link
Contributor

leezen commented Dec 15, 2021

You'll need to alias to the original parent; else, the engine will attempt to create a new resource. Does this issue reproduce if you do that?

@liubog2008
Copy link
Author

It resolve my problem but is not elegant. We know kubernetes has a declarative API, but pulumi lets me back to write the imperative logic.

In this case, I have to save some codes(alias) which may only be executed once.

@leezen
Copy link
Contributor

leezen commented Dec 15, 2021

Thanks for confirming. Once the resource is migrated, you can remove the alias. For context, #458 has a lot of discussion on the design. Open to taking any feature requests on how you think this could be easier.

@leezen leezen added kind/question Questions about existing features resolution/fixed This issue was fixed labels Dec 15, 2021
@leezen leezen closed this as completed Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions about existing features resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

3 participants