sparse-intern-71089
03/09/2022, 4:33 PMechoing-dinner-19531
03/09/2022, 4:58 PMsecretName_list = serviceAccountArray.map(ksa => {
let resourceId : pulumi.Input<string> = "thx/".concat(ksa.name); //"namespace/shared-keystore-jks-ksa" ;
let secrets: pulumi.Output<output.core.v1.ObjectReference[]> = k8s.core.v1.ServiceAccount.get("ksa-".concat(ksa.name),resourceId).secrets;
secrets.apply(v => v[0].name);
});
big-psychiatrist-43588
03/09/2022, 5:24 PMvar secretName_list = args.applicationSecrets.map(ksa => {
let resourceId : pulumi.Input<string> = "thx/".concat(ksa.name); //"namespace/shared-keystore-jks-ksa" ;
let secrets: pulumi.Output<output.core.v1.ObjectReference[]> = k8s.core.v1.ServiceAccount.get("ksa-".concat(ksa.name),resourceId).secrets;
console.log("secrent name");
secrets.apply(v => v[0].name);
})
console.log ("arraylist ",secretName_list);
It returns the array with undefined items
looks like the apply executed later and array get populated with undefined value.big-psychiatrist-43588
03/09/2022, 5:25 PMechoing-dinner-19531
03/09/2022, 5:29 PMvar secretName_list = args.applicationSecrets.map(ksa => {
let resourceId : pulumi.Input<string> = "thx/".concat(ksa.name); //"namespace/shared-keystore-jks-ksa" ;
let secrets: pulumi.Output<output.core.v1.ObjectReference[]> = k8s.core.v1.ServiceAccount.get("ksa-".concat(ksa.name),resourceId).secrets;
console.log("secrent name");
return secrets.apply(v => v[0].name);
})
echoing-dinner-19531
03/09/2022, 5:29 PMhow can we check the operation in apply executed synchronouslyYou can't because they won't, and there's no way to ask Pulumi to do that. During
preview
we might not even run the code inside an apply
big-psychiatrist-43588
03/09/2022, 5:44 PMarraylist [
OutputImpl {
__pulumiOutput: true,
resources: [Function (anonymous)],
allResources: [Function (anonymous)],
isKnown: Promise { <pending> },
isSecret: Promise { <pending> },
promise: [Function (anonymous)],
toString: [Function (anonymous)],
toJSON: [Function (anonymous)]
},
OutputImpl {
__pulumiOutput: true,
resources: [Function (anonymous)],
allResources: [Function (anonymous)],
isKnown: Promise { <pending> },
isSecret: Promise { <pending> },
promise: [Function (anonymous)],
toString: [Function (anonymous)],
toJSON: [Function (anonymous)]
}
]
how would i get the value from itechoing-dinner-19531
03/09/2022, 5:48 PMechoing-dinner-19531
03/09/2022, 5:51 PMbig-psychiatrist-43588
03/10/2022, 10:10 AMNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by