Has anyone ran into this pulumi preview issue with...
# golang
b
Has anyone ran into this pulumi preview issue with Golang before? We have noticed if we use the output of one resource as the input to a nested attribute of an input, the sdk is marking the whole input object as unknown, rather than isolating the unknown tag to that nested attribute. For something like a kubernetes manifest or azure container app template, it renders. previews almost useless. Has anyone else encountered this before?
👀 1
e
Yeh this happens in all the runtimes to varying degrees. It depends on where the "output" layer is put into the type system. Higher up is generally easier to work with, but means whole attributes get collapsed to unknown.
👍 1
If you've got specific attributes causing issues we can take a look and see about releasing an SDK that tracks more fine-grained
b
I can't say I remember ever seeing the behavior in typescript
e
I think typescript puts output attributes at nearly every data layer
b
the attributes I'm running into at the moment are anything in the template input for azure container apps https://www.pulumi.com/registry/packages/azure-native/api-docs/app/containerapp/#template
if any env var, secret, or image comes from the output of another resource, it shows the whole thing as unknown. I've also seen really weird behavior where if the env var is marked as secret by pulumi and I use
--show-secrets
it seems to nest the whole template object into each env var that it's changing. It's reallllllly strange 🤔 but that seems to be a separate issue from how it presents itself.
@echoing-dinner-19531 just to confirm, is this an issue with the provider or the pulumi sdk for go?
e
In general for these shapes of problems it could be either, in this case I think its the Go sdk
b
is it fair to say that the go sdk isn't allowing diffs to be calculated in a nested manner if it sees a secret or output in the input object at all?
e
yes
b
Gotcha, thanks! I looked before and didn't see an issue logged for this behavior. Do you have any idea if others run into this issue as well and if it's acceptable for them? I'm curious if there are workarounds that others have used, cause it seems somewhat unusable in this state for us since we can't see the actual diff when we run a preview.
e
I think Go is our least used language, but I have heard this complaint pop up now and again. It's not even unique to Go, the other languages can end up with odd serialisation states as well. We're very interested in doing a new Go SDK once Go 1.27 is released with better support for generics, and this is something we'll keep in mind for that. I don't know if there's any workaround in the meantime, but do raise an issue so it can stay tracked, and maybe get some others thoughts on it as well.
b
Is there an easy way to tell if we would run into the same issue with typescript? We're considering shifting to TS if we can see the actual container app diffs.
e
I don't think typescript suffers from this because the dynamic typing means you can actually end up with outputs nested rather than one top level output type that does all the unknown tracking
👍 1