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

dependsOn Doesn't Consume Helm Chart's Ready Output #1591

Closed
mate201 opened this issue May 27, 2021 · 2 comments
Closed

dependsOn Doesn't Consume Helm Chart's Ready Output #1591

mate201 opened this issue May 27, 2021 · 2 comments
Labels
kind/question Questions about existing features resolution/fixed This issue was fixed

Comments

@mate201
Copy link

mate201 commented May 27, 2021

Depends on fails to consume the helm chart's ready output.

Sorry for not being precise. I don't clearly understand generics in Typescript, so my explanation maybe is not clear, but I think the compilator error is pretty self-explanatory.

Steps to reproduce

import * as k8s from "@pulumi/kubernetes";

const chart = new k8s.helm.v3.Chart("nginx", {
    chart: "nginx",
    namespace: "blabla",
    values: {
        service: {
            type: "ClusterIP"
        }
    },
    fetchOpts: {
        repo: "https://charts.bitnami.com/bitnami"
    },
})

const abc = new k8s.core.v1.ConfigMap("test",
    {
        data: { foo: "bar" }
    }
)


const abc2 = new k8s.core.v1.ConfigMap("test",
    {
        data: { foo: "bar" }
    },
    {
        dependsOn: [abc, chart.ready],
    }
)

On the dependsOn: [abc, chart.ready] line compilator throws such error:

Type 'Output<CustomResource[]>' is not assignable to type 'Input<Resource>'.
  Type 'Output<CustomResource[]>' is not assignable to type 'OutputInstance<Resource>'.
    Types of property 'apply' are incompatible.
      Type '{ <U>(func: (t: CustomResource[]) => Promise<U>): Output<U>; <U>(func: (t: CustomResource[]) => OutputInstance<U>): Output<...>; <U>(func: (t: CustomResource[]) => U): Output<...>; }' is not assignable to type '{ <U>(func: (t: Resource) => Promise<U>): Output<U>; <U>(func: (t: Resource) => OutputInstance<U>): Output<U>; <U>(func: (t: Resource) => U): Output<...>; }'.
        Types of parameters 'func' and 'func' are incompatible.
          Types of parameters 't' and 't' are incompatible.
            Type 'CustomResource[]' is missing the following properties from type 'Resource': urn, getProviderts(2322)

This issue comes from here: #1364

@mate201 mate201 added the kind/bug Some behavior is incorrect or out of spec label May 27, 2021
@mate201 mate201 changed the title dependOn Doesn't Consume Helm Chart's Ready Output dependsOn Doesn't Consume Helm Chart's Ready Output May 27, 2021
@lukehoban
Copy link
Member

I believe the issue is that ready is a pulumi.Output<pulumi.CustomResource[]>, so you can pass it alone to dependsOn: chart.ready, but if you need to add to it - you would need to do dependsOn: chart.ready.apply(ready => [abc, ...ready]).

@lukehoban lukehoban added kind/question Questions about existing features resolution/fixed This issue was fixed and removed kind/bug Some behavior is incorrect or out of spec labels May 28, 2021
@mate201
Copy link
Author

mate201 commented May 31, 2021

Hello Luke,

Thank you for checking this issue. And what if I want to depend on a say three charts, like Cilium, Prometheus, and something else? At the moment I'm just using '@ts-ignore' like this:

{
    provider: ****,
    dependsOn: [
        cluster.egressNodeGroup,
        // @ts-ignore
        ciliumChart.ready,
        // @ts-ignore
        nginxChart.ready
    ]
}

It's a kludge of course, but it gives me an opportunity to spend time on different issues that are more important at the moment.

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

2 participants