https://pulumi.com logo
#python
Title
# python
s

stocky-refrigerator-75813

03/12/2024, 3:20 PM
Hi, I'm having a bit of a mental block. i'm trying to read an existing
Secret
value from a cluster. I've got the following code:
Copy code
cert_ca = k8s.core.v1.Secret.get("ou-tls-certificate","openunison/ou-tls-certificate").data["ca.crt"].apply(lambda data: str(data)  )
a

adventurous-butcher-54166

03/12/2024, 8:43 PM
Don't have a setup to validate but have you tried?
Copy code
cert_ca = k8s.core.v1.Secret.get("ou-tls-certificate","openunison/ou-tls-certificate").data.apply(lambda data: data.get("ca.crt", "undefined"))
s

stocky-refrigerator-75813

03/12/2024, 9:51 PM
ended up realizing the issue was i was trying to log before preview happened. once i skipped the logging it mostly worked. still trying to figure out how to delay the preview until after the secret gets generated