Sorry, I have another question… I’m trying to impr...
# general
f
Sorry, I have another question… I’m trying to improve my stack’s code now. In my
index.ts
I’m creating first a gke cluster then I’m adding the external dns
Chart
. Problem is, the chart needs the
k8sProvider
from the
Cluster
, or pulumi is running both in parallel, which of course makes the
Chart
accounts and roles creation fail. I tried to add my cluster object to the
dependsOn
key of the
Chart
opts
but it doesn’t wait for it anyway. How can I ensure something is created before anything else depending on it runs ? I thought it would be automatic by referencing the provider from the cluster, but it’s not.
Hum, ok I found out my problem. Actually the provider was
undefined
because of an error I did, but there was no clue at all about it. Maybe you should ensure when someone sets a
provider(s)
value in the
opts
of a component it is defined in since there’s no point to provide an undefined value voluntarily here.
w
Yes - very good idea. The one slight concern here is that generally
x: undefined
is treated the same as leaving
x
out of the object in the first place. This helps with compositionally. We'd be violating that equivalence if we errored in this case. Probably still worth doing that though to make this easier to discover/debug.
f
Yeah I was thinking about that too. But I think this could become a common mistake and that’s a nasty one to find out since there’s no clear error (pulumi fallback to the
kubectl
config if there’s no provider).