Is there a way to get an object not created by Pul...
# kubernetes
n
Is there a way to get an object not created by Pulumi in code?, I'm trying to get the token for an SA created via Pulumi (the secret is automatically created by kubernetes), but the method (Go code) requires a Pulumi ID, I can provde some code samples if required
g
The pulumi ID is
[namespace/]name
of the resource. So if your SA is called “foo” in the “bar” namespace, it would be
bar/foo
n
Ahh..that makes sense, can I search for a Secret via glob?, the secret I'm looking for is named
argocd-manager-token-{5-random-characters}
, I can get the name from the SA but it's saved as a
pulumi.OutputString
so I can't use it as a
string
in the
GetSecret
call (I'm using Go for this)
g
No, currently get only works with a known id. You should be able to call
GetSecret
within an Apply, which will resolve the SA so you can get the name. I’m tracking improvements to the get UX here if you have any feedback to add: https://github.com/pulumi/pulumi-kubernetes/issues/1656