Hi. Is there a way to understand at runtime that i...
# golang
m
Hi. Is there a way to understand at runtime that it is a preview? I have logic in pulumi, that make nslookup in applier function. And it waits in the applier until nslookup returns for example 3 addresses. But during the preview my changes are not applied and code hangs in the endless loop like waiting for the wrong amount of ip addresses to return. So I'd like to remove this condition when preview is running. I've found pulumi.runtime.isDryRun() only in TypeScript.
✔️ 1
Found this. if apitype.PreviewUpdate == "preview" { ... } But it's wrong. This is constant :DDD It is always preview.
m
@lemon-agent-27707 Could you give me a way how to find such stuff? Tried to google something like DryRun and so on, but didn't come to the solution. It made sense to go to context and go through its methods, sure. But maybe there is more simple way and I just do not see it? Thank you.
l
The godocs on pkg.go.dev are the source of truth for our Go SDK documentation. Agree that the SEO on that page is not great 😞