When trying to deploy a helm chart using pulumi, a marshaling error occurs and the program fails
Diagnostics:
pulumi:pulumi:Stack (chart-crd-dev):
2020/12/06 09:55:33 info: skipping unknown hook: "crd-install"
error: program failed: cannot marshal an input of type *v1.Service as a value of type pulumi.Resource
exit status 1
error: an unhandled error occurred: program exited with non-zero exit code: 1
It's a different resource each time but same error. It also doesn't happens with pulumi-kubernetes v2.7.1 and below
go 1.15.5
pulumi v2.15.1
pulumi-kubernetes 2.7.3
package main
import (
"github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes/helm/v3"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := helm.NewChart(ctx, "jaeger-operator", helm.ChartArgs{
Chart: pulumi.String("jaeger-operator"),
FetchArgs: helm.FetchArgs{
Repo: pulumi.String("https://jaegertracing.github.io/helm-charts"),
},
})
if err != nil {
return err
}
return nil
})
}
Might be related to https://github.com/pulumi/pulumi-kubernetes/issues/1396
+1
I can confirm this is happening at 2.7.5
I am able to repro this error starting with the k8s provider at v2.7.2. Looking into this now.
The bug seems to be specific to the Go SDK, as this is working in TypeScript. My best guess so far is that this is related to the changes in https://github.com/pulumi/pulumi/pull/5497
@pgavlin @justinvp I'm not quite sure, but it seems like this happens because all of the k8s resources now satisfy the pulumi.Resource interface (due to https://github.com/pulumi/pulumi/pull/5497). I think it's being called from here: https://github.com/pulumi/pulumi/blob/62abd821e91e5c187e33ce6d1864599f0ad30ce3/sdk/go/pulumi/rpc.go#L140
It could also be related to the fact that the Helm SDK registers the resource as a map-typed Input (https://github.com/pulumi/pulumi/pull/4521).
Any ideas on fixing?
Any ideas on fixing?
I'm not sure about this one. @pgavlin?
Pat helped me figure this out -- it's a problem with the generated Input/Output methods on the resources. I'll fix the codegen and then pull this into the k8s provider.
https://github.com/pulumi/pulumi/pull/5916 fixes this issue
I'm still hitting this issue on v2.15.6 of the SDK and the pulumi binary. I see the change from pulumi/pulumi#5916 was in that release.
Wondering if the actual fix I need is #1406, rather than what was released in v2.15.6?
Specifically, here's the error I see:
Diagnostics:
pulumi:pulumi:Stack (demo-dev):
error: program failed: cannot marshal an input of type *v1.Service with element type v1.Service as a value of type pulumi.Resource
exit status 1
error: an unhandled error occurred: program exited with non-zero exit code: 1
Wondering if the actual fix I need is #1406, rather than what was released in
v2.15.6?
Yes, this fix hasn't made it into the k8s provider yet. We ran into a couple other bugs that are blocking the release, but will get this out ASAP. Thanks for your patience; you should be able to use a k8s provider version < v2.15.3 in the meantime if this is blocking you.
This should be fixed in https://github.com/pulumi/pulumi-kubernetes/releases/tag/v2.7.5
Can confirm this is resolved in pulumi-kubernetes v2.7.5 with pulumi v2.16.0. Thanks @lblackstone !