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

Resource IDs are incorrect for computed namespaced resources #409

Closed
lblackstone opened this issue Feb 6, 2019 · 1 comment · Fixed by #483
Closed

Resource IDs are incorrect for computed namespaced resources #409

lblackstone opened this issue Feb 6, 2019 · 1 comment · Fixed by #483
Assignees
Labels
area/sdk Related to the Kubernetes SDKs (nodejs, Python, etc.) kind/bug Some behavior is incorrect or out of spec
Milestone

Comments

@lblackstone
Copy link
Member

Namespaced resources are showing up incorrectly in the CLI output:

 +      ├─ kubernetes:core:Service     [object Object]/frontend          create
 +      ├─ kubernetes:core:Service     [object Object]/redis-master      create

This is due to

const meta = obj["metadata"];
let id: string = meta["name"];
const namespace = meta["namespace"] || undefined;
if (namespace !== undefined) {
id = `${namespace}/${id}`;
}

I tried fixing the problem with

        const meta = obj["metadata"];
        let id: pulumi.Output<string> = meta["name"];
        const namespace = meta["namespace"] || undefined;
        if (namespace !== undefined) {
            id = pulumi.all([namespace, id]).apply(([ns, id]) => `${ns}/${id}`)
        }

but the following constructors are all expecting name: string. Changing that type would require updating the pulumi/pulumi SDK as well, which has bigger implications.

@hausdorff
Copy link
Contributor

More specifically, for computed namespace names. For most people this should still work.

@lblackstone lblackstone changed the title Resource IDs are incorrect for namespaced resources Resource IDs are incorrect for computed namespaced resources Feb 6, 2019
@lblackstone lblackstone self-assigned this Mar 8, 2019
@lblackstone lblackstone added this to the 0.22 milestone Mar 8, 2019
@lblackstone lblackstone added kind/bug Some behavior is incorrect or out of spec area/sdk Related to the Kubernetes SDKs (nodejs, Python, etc.) labels Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sdk Related to the Kubernetes SDKs (nodejs, Python, etc.) kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants