diff --git a/src/main/helm/helm-release-manager.ts b/src/main/helm/helm-release-manager.ts index 4c6e974152..f0907dc3c2 100644 --- a/src/main/helm/helm-release-manager.ts +++ b/src/main/helm/helm-release-manager.ts @@ -194,6 +194,11 @@ async function getResources(name: string, namespace: string, kubeconfigPath: str "--kubeconfig", kubeconfigPath, "-f", "-", "--output", "json", + // Temporary workaround for https://github.com/lensapp/lens/issues/6031 + // and other potential issues where resources can't be found. Showing + // no resources is better than the app hard-locking, and at least + // the helm metadata is shown. + "--ignore-not-found", ]; try { @@ -208,9 +213,13 @@ async function getResources(name: string, namespace: string, kubeconfigPath: str .on("exit", (code, signal) => { if (typeof code === "number") { if (code === 0) { - const output = json.parse(stdout) as { items: JsonObject[] }; + if (stdout === "") { + resolve([]); + } else { + const output = json.parse(stdout) as { items: JsonObject[] }; - resolve(output.items); + resolve(output.items); + } } else { reject(stderr); }