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

busy-pizza-73563

03/11/2019, 5:20 PM
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

creamy-potato-29402

03/11/2019, 7:14 PM
@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

busy-pizza-73563

03/11/2019, 7:14 PM
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

creamy-potato-29402

03/11/2019, 7:27 PM
@busy-pizza-73563 there is
pulumi.runtime.isDryRun()
b

busy-pizza-73563

03/11/2019, 7:29 PM
Oh, niiice, exactly what I needed! Thanks!
Now the only remaining issue is that dummy annotation.
c

creamy-potato-29402

03/11/2019, 7:47 PM
yeah, at some point we will fix that.
b

busy-pizza-73563

03/11/2019, 9:31 PM
Do you know if there's an issue I can track?
w

white-balloon-205

03/12/2019, 1:09 AM
Opened https://github.com/pulumi/pulumi/issues/2545. Feel free to add any additional notes there.