https://pulumi.com logo
#general
Title
# general
c

cool-egg-852

09/06/2019, 11:59 PM
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

white-balloon-205

09/07/2019, 12:23 AM
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

cool-egg-852

09/07/2019, 12:29 AM
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

white-balloon-205

09/07/2019, 12:29 AM
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

cool-egg-852

09/07/2019, 12:30 AM
They’re also created by a few jobs, not even necessarily directly.
w

white-balloon-205

09/07/2019, 12:32 AM
Actually - I haven't tried yet - but does this work:
Copy code
{ dependsOn: chart.resources.apply(o => Object.values(o)) }
c

cool-egg-852

09/07/2019, 12:34 AM
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

bitter-dentist-28132

09/07/2019, 12:35 AM
for cert-manager i was able to do
Copy code
const dependsOn = certManager.resources.apply(resources => Object.keys(resources).map(key => resources[key]));
c

cool-egg-852

09/07/2019, 12:35 AM
Output<CustomResource[]> must have a [Symbol.iterator]() method
w

white-balloon-205

09/07/2019, 12:36 AM
You can do:
Copy code
{ dependsOn: c.resources.apply(o => [someOtherResource, ...Object.values(o)]) }
b

bitter-dentist-28132

09/07/2019, 12:36 AM
(i had the same problem with cert-manager, and that fixed the problems i was having)
c

cool-egg-852

09/07/2019, 12:37 AM
No more type errors @white-balloon-205
w

white-balloon-205

09/07/2019, 12:38 AM
@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

bitter-dentist-28132

09/07/2019, 12:39 AM
yup, i know, not sure why i didn't do
Object.values
there
c

creamy-potato-29402

09/07/2019, 5:53 PM
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.