faint-motherboard-95438
05/18/2020, 10:13 PMdependsOn
works and if it’s the solution to my problem.
From what I understand here https://www.pulumi.com/docs/intro/concepts/programming-model/#dependson it should properly wait for a previous resource to be available for the one I’m referencing it in.
In my usecase I provision postgresql with an helm chart and my migration service needs to wait in order to connect to it. Unfortunately, having inputs from the chart nor having it explicitly define in the dependsOn
does not make my service wait for all the services in the chart available and of course it fails since the database service is not available yet.
How am I supposed to properly define dependencies when pulumi fails to understand a specific case then ?busy-umbrella-36067
05/18/2020, 10:15 PMdependsOn
to the chart or inside the transformations
faint-motherboard-95438
05/18/2020, 10:16 PMdependsOn
in a following ComponentResource
of mine which depends on the database helm chart to be fully up&runningbusy-umbrella-36067
05/18/2020, 10:18 PMfaint-motherboard-95438
05/18/2020, 10:18 PMbusy-umbrella-36067
05/18/2020, 10:19 PMfaint-motherboard-95438
05/18/2020, 10:19 PMComponentResource
to be precise. I tried to depends on this “container” and also directly on the chart inside itself, both failed.busy-umbrella-36067
05/18/2020, 10:20 PMJob
which loops until your DB is reachable.faint-motherboard-95438
05/18/2020, 10:21 PMComponentResource
and Chart
dependencies. I’ll try thatJob
, will have a look, but that’s kind of “dirty” workaround I guessbusy-umbrella-36067
05/18/2020, 10:22 PMJob
faint-motherboard-95438
05/18/2020, 10:28 PMchart.getResource()
method, trying right nowgorgeous-egg-16927
05/18/2020, 10:29 PMbusy-umbrella-36067
05/18/2020, 10:30 PMchart.getResource()
as an output and that way all you would need to dependsOn
is your first component
The call to registerOutputs also tells Pulumi that the resource is done registering children and should be considered fully constructed, so—although it's not enforced—the best practice is to call it in all components even if no outputs need to be registered.
faint-motherboard-95438
05/18/2020, 10:34 PMgetResource()
works and my component holds until the database services are up.
Will try the cleaner way with registerOutputs()
right awaygetResource()
and directly depending on the resource(s) needed in dependsOn
works, registering the same resource(s) in registerOutputs()
and only using the top ComponentResource
as a dependency unfortunately does not work as expected.
I’ll stick to direct references the resources I need to wait for, for now. Thanks for your help !busy-umbrella-36067
05/18/2020, 10:42 PMdependsOn
altogetherfaint-motherboard-95438
05/18/2020, 10:44 PM