does pulumi wait for k8s jobs to finish instead of...
# kubernetes
n
does pulumi wait for k8s jobs to finish instead of just launching them?
b
I believe it's wait for it to complete. We have Deployment updates block on database migration Jobs in our Pulumi program, and it works great.
g
Yes, the default behavior is to wait for readiness. You can see details of any readiness checks for a resource in the API docs: https://www.pulumi.com/registry/packages/kubernetes/api-docs/batch/v1/job/#job You can disable the wait behavior by setting the
<http://pulumi.com/skipAwait|pulumi.com/skipAwait>
annotation on the resource.
n
I have a question, how do you block the deployment? Do I have to keep the job at the start of
index
file and then keep everything else in an
if
condition like this
Copy code
if (dbMigrationJob.status.conditions[0].type.apply(t => t === 'Complete')) {
    // run everything else like creating new image, pushing to ecr, creating deployment,etc
}
g
how do you block the deployment?
If I understand your question correctly, you need to specify the Job as a resource dependency. https://www.pulumi.com/docs/intro/concepts/resources/options/dependson/ has more information on this.