sparse-intern-71089
06/21/2021, 11:59 PMlittle-cartoon-10569
06/22/2021, 12:28 AMapply
on sectionName[0].name
, rather than secretName
.little-cartoon-10569
06/22/2021, 12:28 AMsecretName
is 🙂steep-toddler-94095
06/22/2021, 2:06 AMinterpolate
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
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']);
});
});
brave-glass-88708
06/22/2021, 5:42 PM