Why does dependsOn not work for depending upon the...
# general
c
Why does dependsOn not work for depending upon the completion of a helm chart?
It seems to only wait for the chart itself to register, not for all of the sub resources. Instead, it should wait for the full chart to complete
w
Yes - currently
dependsOn: component
does not implicitly depend on it's children. We are considering giving it that semantic as part of https://github.com/pulumi/pulumi/issues/1743.
c
Thanks for the update.
Currently without this istio may have troubles deploying in a single pass as the CRDs have to be created first, and they are in a separate helm chart.
w
It should be possible to construct the dependencies on all of the child resources manually today from
.resources
- but it's a little hairy at the moment.
c
They’re also created by a few jobs, not even necessarily directly.
w
Actually - I haven't tried yet - but does this work:
Copy code
{ dependsOn: chart.resources.apply(o => Object.values(o)) }
c
I’ll give it a shot!
Hmm, problem is I can’t seem to have other dependencies. I tried
{ dependsOn: [...chart.resources.apply(o => Object.values(o)), someOtherResource] }
and got a type error
b
for cert-manager i was able to do
Copy code
const dependsOn = certManager.resources.apply(resources => Object.keys(resources).map(key => resources[key]));
c
Output<CustomResource[]> must have a [Symbol.iterator]() method
w
You can do:
Copy code
{ dependsOn: c.resources.apply(o => [someOtherResource, ...Object.values(o)]) }
b
(i had the same problem with cert-manager, and that fixed the problems i was having)
c
No more type errors @white-balloon-205
w
@bitter-dentist-28132 Yep - your code is morally doing the exact same thing - so great to hear that that did work for you! Note that
Object.values(o)
is just a slightly easier way to accomplish
Object.keys(o).map(key => o[key])
.
b
yup, i know, not sure why i didn't do
Object.values
there
c
this is a fundamental problem with the way helm works, and the way istio attempts to get around it.
you don’t really have any good options until the lua lifecycle hooks are implemented.