acoustic-toothbrush-71581
10/18/2019, 5:27 PMapply()
I seem to get another promise? is this expected I didn't believe it would be. Am I taking the wrong approach here? Is there a better way? Currently we are loading the js kubernetes client and loading a kubeconfig then using it to check the deployment status. However we support at least 3 managed k8s providers and each of the pulumi modules have different ways to obtain the kubeconfig, making this harder. I was hoping to load a client from pulumis modules to check the deployment status.
// Deploy cert-manager
const certmanagerResources = new k8s.yaml.ConfigFile("cmResources", { file: `<https://github.com/jetstack/cert-manager/releasesdownload/${args.version}/cert-manager.yaml>`
let deployment = certmanagerResources.getResource("apps/v1/Deployment", "cert-manager-webhook")
deployment.apply(k => { k.status ) })` // error status isn't a propery
console.log(Object.getOwnPropertyNames(deployment))
console.log(deployment.apply(k => { Object.getOwnPropertyNames(k) }))
//results in
[ '__pulumiOutput',
'isKnown',
'isSecret',
'resources',
'promise',
'toString',
'toJSON',
'apply',
'get' ]
OutputImpl {
__pulumiOutput: true,
isKnown: Promise { <pending> },
isSecret: Promise { <pending> },
resources: [Function],
promise: [Function],
toString: [Function],
toJSON: [Function],
apply: [Function],
get: [Function] }
gorgeous-egg-16927
10/18/2019, 6:17 PMacoustic-toothbrush-71581
10/18/2019, 6:21 PMgorgeous-egg-16927
10/18/2019, 7:46 PMdeployment.apply(k => { console.log(Object.getOwnPropertyNames(k)) })
The return value of an apply
is an Output, but it’s unwrapped/resolved within the function inside of apply()