Hi Guys, Is there a way to decide / query which st...
# general
Hi Guys, Is there a way to decide / query which stage is running in pulumi up. There is some checking, information gathering stage and there is an update stage. Can I ask/query this with some Pulumi function? Because I would like to make some custom Pulumi resource and it would be great to avoid double runs. Can you please helm me out? Thanks
You mean preview vs. update? There is a
(https://pulumi.io/reference/pkg/nodejs/@pulumi/pulumi/runtime/#isDryRun) function which will answer that. This can be useful for simple things, but for more complex things you generally end up wanting to use a dynamic provider to be able to participate fully in the resource lifecycle.
Yes preview vs update thanks...I am still learning terminology
Luke, in python I got True in both case
This is my code
🙂 it is pretty simple
this is the CLI output
What I miss? 🙂
Hmm - that’s doesn’t look right. Do you need the bool conversion there? I would have expected you to need that. We use this ourselves in the implementation, so it should work correctly: https://github.com/pulumi/pulumi/search?utf8=✓&q=is_dry_run&type= Cc also @incalculable-sundown-82514
same without bool casting, I just like to do that 🙂 but i can remove it
Here is the code again
I am checking your link
I have changed the code for this
but same result
python modules
Thanks 😉
i’m just catching up on this thread, are you still seeing the problem?
Yes Sean
Can you print out the value of
when doing a preview?
And it’s false when doing an update?
@incalculable-sundown-82514 It's never false at me. I think there are 2 stages on the picture above, but please correct me if not. There is a preview stage with return value "True" and there is an update stage with return value True too and I think this last one is the problem. So in both case I got True. Maybe I miss something, I dont know, this is why I came to ask.
If I skip the preview I get also True
hmm, that’s super strange - i’ll take a look today.
opened https://github.com/pulumi/pulumi/issues/2360 at high priority - thanks for the report, and sorry for the delay in following-up here!
Thanks Sean
I have a fix for the issue here: https://github.com/pulumi/pulumi/pull/2361. It’ll be in the next release of Pulumi, but if you’re blocked on this issue you can make this change https://github.com/pulumi/pulumi/pull/2361/files#diff-c136b8e513dc228c53777067bc4a87fd to this file, located in your installation adjacent to the