stocky-island-3676
09/06/2019, 5:26 PMdata
values of a Kubernetes Secret.get()
such as (in pseudo-language):
type ServiceAccountSecretData = [
"ca.crt": string,
"namespace": string,
"token": string,
]
The “only” thing I’ve come up yet is with type SecretData = { [key: string]: string }
(see attached snippet).white-balloon-205
.data
itself will be a { [id: string]: string}
map as you note, where the values of each entry are base64-encoded binary content. So I think the code you have above is about right - though it's likely you want to base64 decode the value before returning it.
I am honestly not exactly sure why this property is typed as object
instead of { [key: string]: string }
as stringData
is.stocky-island-3676
09/09/2019, 3:14 PM.data
object with a specific type kind of like the ServiceAccountSecretData
I mentioned?
Didn’t find a reason for why the Secret.data
isn’t of type stringData
, yet.
Secret.stringData
itself is a “write-only convenience method”. Hard to find out when it was introduced as the provider.ts
was splitted here: https://github.com/pulumi/pulumi-kubernetes/pull/480/files?file-filters%5B%5D=.ts#diff-f68b8bd99be4835ca9d8a3c3a820df9dR48white-balloon-205
object
to { [id: string]: string }
, as that is the type the value actually will have. But you’ll need to wrote actual deserialization code to base64 decode and parse the contents of you have some more specific data you are trying to extract.stocky-island-3676
09/09/2019, 3:30 PM{ [key: string]: string }
?
Convenience for infrastructure coding. That’s what Pulumi is about in the long-run, isn’t it?