This message was deleted.
# general
s
This message was deleted.
l
In this style code, you would need to
apply
on
sectionName[0].name
, rather than
secretName
.
I don't know if that will work though, since I don't know what
secretName
is 🙂
s
you need to use
interpolate
to concat `Output<string>`s, but you don't need to use this if you use
secretName.namespace
. And you can use array pattern matching to assign the first element to the variable
secretName
Copy code
import * as k8s from "@pulumi/kubernetes";
import * as kx from "@pulumi/kubernetesx";

const serviceAccount = new k8s.core.v1.ServiceAccount("test-service-account");

serviceAccount.secrets.apply(([secretName]) => {
    console.log(secretName.name);
    const token = k8s.core.v1.Secret.get(secretName.name, `${secretName.namespace}/${secretName.name}`).data.apply(v => {
        console.log(v['token']);
    });
});
b
thanks for the info