Is there a way for a (kubernetes) resource to depe...
# general
b
Is there a way for a (kubernetes) resource to depend on a
Promise<void>
(i.e. it doesn't return anything, it only waits for a condition), other than doing something like
Copy code
new k8s.some.v1.Resource(name, {
  metadata: {
    annotations: {
      someDummyAnnotation: waitForCondition() // should return Promise<string>
    }
  }
});
?
c
@busy-pizza-73563 there was once a thought that we shoudl make
dependsOn
take promises. I think we did not do this, cc @microscopic-florist-22719 and @white-balloon-205
b
Well, I really hoped so, tried and failed. 🙂
Also, I just noticed that ^^ has the drawback of calling
waitForCondition()
during preview, too, which is not really what I want. 😐 Any way of detecting whether in the preview or apply phase?
c
@busy-pizza-73563 there is
pulumi.runtime.isDryRun()
b
Oh, niiice, exactly what I needed! Thanks!
Now the only remaining issue is that dummy annotation.
c
yeah, at some point we will fix that.
b
Do you know if there's an issue I can track?
w
Opened https://github.com/pulumi/pulumi/issues/2545. Feel free to add any additional notes there.