I am running this async function:
async function getIngress(namespace) {
try {
const result = await k8sIngressApi.listNamespacedIngress(namespace, true);
return result.body.items[0].spec.rules[0].http.paths[0].path;
} catch (e) {
console.error(e.response.body);
}
}
console.log(getIngress(argument);
The console log only prints a promise. Is there a way I can access the returned value of the promise outside of a function like I am trying to?