This message was deleted.
# general
s
This message was deleted.
l
StackReference.getOutput returns an Output. Provider's kubeConfig property takes a string. You're going to need to do some conversion..
I can't see how that example would work. I would have thought you'd need to
await
a
getOutputValue
to make that example work...
m
well, it looks like
kubeconfig
takes a
string | pulumi.OutputInstance<string> | Promise<string> | undefined
I thought a
pulumi.Output
was a promise too, but I guess not im trying out
StackReference.getOutputValue()
instead (and
requireOutputValue()
)
still seeing the same error, even when using the -Value() methods, which return
Promise<any>
. 😞
g
@many-psychiatrist-74327 can you share your code?
m
yup!
Copy code
const stack = pulumi.getStack()
const infra = new pulumi.StackReference(`jetpack/infra/${stack}`)
const provider = new k8s.Provider('infra-cluster-provider', {
    kubeconfig: infra.getOutput("kubeconfig")
})
i also tried
infra.getOutputValue("kubeconfig")
(same error) and
infra.getOutput("kubeconfig").get()
(different error, cannot call .get() during preview/up
tried using
await
, but it requires target of
es2017
or higher.
pulumi new
sets the target to
es2016
, presumably for good reason (haven’t tried changing it yet)
g
And you're getting
interface conversion: interface {} is resource.PropertyMap, not string
as the error?
m
correct
Copy code
pulumi version
v2.10.0
b
Hi guys, I've got the same issue. For my case, it only happens on an update. When I do a freshly creation of the stack resources (e.g. after destroy) the error does not show up. It only happens when the resources already exist. And it even happens, when I use a plain string for kubeconfig, e.g. new k8s.Provider('my-provider', { kueconfig: "hard-coded-kubeconfig" }) Any ideas?
m
🎉 good observation, @bitter-toddler-22112! I confirm the same behavior: after I did a
pulumi destroy
and re-creation, without changing any of the code, the error went away.