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 AM