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

Unable to move namespaces between projects #496

Open
DenMX opened this issue Jun 14, 2024 · 7 comments
Open

Unable to move namespaces between projects #496

DenMX opened this issue Jun 14, 2024 · 7 comments
Assignees
Labels
area/import An issue related to `pulumi import` or the import resource option. awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). blocked The issue cannot be resolved without 3rd party action. kind/enhancement Improvements or new features

Comments

@DenMX
Copy link

DenMX commented Jun 14, 2024

Describe what happened

When i trying import existing cluster i got an exception thath says report bug :)

rancher2:index:Cluster (devops.test):
   error: Preview failed: importing devops.test.cluster: importer for devops.test.cluster returned a empty resource state. This is always the result of a bug in the resource provider - please report this as a bug in the Pulumi provider repository.

i created only provider for feature work with pulumi and then try to import cluster with command:
pulumi import rancher2:index/cluster:Cluster devops.test devops.test.cluster

Sample program

pulumi import rancher2:index/cluster:Cluster devops.test devops.test.cluster

Log output

rancher2:index:Cluster (devops.test):
error: Preview failed: importing devops.test.cluster: importer for devops.test.cluster returned a empty resource state. This is always the result of a bug in the resource provider - please report this as a bug in the Pulumi provider repository.

Affected Resource(s)

No response

Output of pulumi about

CLI
Version 3.116.0
Go Version go1.22.2
Go Compiler gc

Plugins
KIND NAME VERSION
resource grafana 0.4.2
resource kubernetes 3.22.1
language python unknown
resource rancher2 6.1.1

Host
OS Microsoft Windows 10 Pro
Version 10.0.19045 Build 19045
Arch x86_64

This project is written in python: executable='C:\Users***\pulumi-rancher\venv\Scripts\python.exe' version='3.9.13'

Current Stack: pulumi-rancher

TYPE URN
pulumi:pulumi:Stack urn:pulumi:pulumi-rancher::pulum::pulumi:pulumi:Stack::pulum-pulumi-rancher
pulumi:providers:rancher2 urn:pulumi:pulumi-rancher::pulum::pulumi:providers:rancher2::pulumi provider

Found no pending operations associated with pulumi-rancher

Backend
Name HP-SDB641
URL s3://pulumi?region=us-east-1&endpoint=sdnexus.specdep.local:8000&disableSSL=true&s3ForcePathStyle=true
User ***
Organizations
Token type personal

Dependencies:
NAME VERSION
hvac 1.0.2
pip 24.0
pulumi-kubernetes 3.22.1
pulumi_rancher2 6.1.1
pulumiverse-grafana 0.4.2
python-dotenv 0.21.0
setuptools 65.4.1
wheel 0.37.1

Pulumi locates its logs in C:\Users***\AppData\Local\Temp by default

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

@DenMX DenMX added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jun 14, 2024
@iwahbe
Copy link
Member

iwahbe commented Jun 14, 2024

Hi @DenMX. Thanks for reporting this issue.

@iwahbe iwahbe added area/import An issue related to `pulumi import` or the import resource option. and removed needs-triage Needs attention from the triage team labels Jun 14, 2024
@DenMX
Copy link
Author

DenMX commented Jun 25, 2024

Hey, after few days working with pulumi rancher i realised that i was confused with cluster id, so this is not a bug, but exception message also not correct.

I don't know where i can ask a question, so...
Is there easy way to change project for existing namespace in inmported cluster with pulumi rancher?

I found few suggestions:

  1. Delete namespace and recreate as pulumi resource
  2. Get in variable existing namespace and created "updated" copy with project_id that i want

1st don't work for me. I can't delete namespaces, there is apps it can ruin something.
And 2nd method don't work for me cause pulumi trying create new namespace with same name, so i got an exception.

It will be legendary if pulumi rancher has a method like "move_namespace" or "move_to_project" somewere, where you can just pass namespace and project_id that needs to apply.

@iwahbe iwahbe added kind/question Questions about existing features and removed kind/bug Some behavior is incorrect or out of spec labels Jun 25, 2024
@iwahbe
Copy link
Member

iwahbe commented Jun 25, 2024

I'm not sure what you mean. I'm not sure if it's possible to change the project_id of an existing project (though I doubt it), or move namespaces between projects.

@iwahbe iwahbe self-assigned this Jun 25, 2024
@iwahbe iwahbe added resolution/by-design This issue won't be fixed because the functionality is working as designed awaiting-feedback Blocked on input from the author and removed resolution/by-design This issue won't be fixed because the functionality is working as designed labels Jun 25, 2024
@DenMX
Copy link
Author

DenMX commented Jun 25, 2024

Move namespaces between projects.

@pulumi-bot pulumi-bot added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Jun 25, 2024
@iwahbe
Copy link
Member

iwahbe commented Jun 27, 2024

I don't believe that moving namespaces between projects is possible with this provider. pulumi-rancher2 is generated from (and has the same capabilities as) rancher/terraform-provider-rancher2, which has as an open issue rancher/terraform-provider-rancher2#891.

That implies that it is not possible to move namespaces between projects with the provider.


If you need to move a namespace between projects, I would try moving the namespace manually (outside of Pulumi), then running pulumi --refresh so Pulumi witnesses the new state. You will then need to adjust your program so it describes your desired state.

@iwahbe iwahbe added awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Jun 27, 2024
@DenMX
Copy link
Author

DenMX commented Jun 28, 2024

Yea, i found a solution - import from terminal, this command can be generated and executed from code. It's a crutch, but it works. Ty for answers!

@pulumi-bot pulumi-bot added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Jun 28, 2024
@iwahbe
Copy link
Member

iwahbe commented Jun 28, 2024

I'm glad you have found a solution. I'll leave this issue open to track the upstream fix.

@iwahbe iwahbe added awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). blocked The issue cannot be resolved without 3rd party action. kind/enhancement Improvements or new features and removed needs-triage Needs attention from the triage team kind/question Questions about existing features labels Jun 28, 2024
@iwahbe iwahbe changed the title Exception while import cluster Unable to move namespaces between projects Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/import An issue related to `pulumi import` or the import resource option. awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). blocked The issue cannot be resolved without 3rd party action. kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

3 participants