mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Merge branch 'master' into feature/command-palette
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
commit
089d928cb3
6 files changed
+72
-22
No files matched your search
@@ -1,4 +1,6 @@
|
||||
import { Application } from "spectron";
|
||||
import * as util from "util";
|
||||
import { exec } from "child_process";
|
||||
|
||||
const AppPaths: Partial<Record<NodeJS.Platform, string>> = {
|
||||
"win32": "./dist/win-unpacked/Lens.exe",
|
||||
@@ -61,3 +63,26 @@ export async function tearDown(app: Application) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
export const promiseExec = util.promisify(exec);
|
||||
|
||||
type HelmRepository = {
|
||||
name: string;
|
||||
url: string;
|
||||
};
|
||||
|
||||
export async function listHelmRepositories(retries = 0): Promise<HelmRepository[]>{
|
||||
if (retries < 5) {
|
||||
try {
|
||||
const { stdout: reposJson } = await promiseExec("helm repo list -o json");
|
||||
|
||||
return JSON.parse(reposJson);
|
||||
} catch {
|
||||
await new Promise(r => setTimeout(r, 2000)); // if no repositories, wait for Lens adding bitnami repository
|
||||
|
||||
return await listHelmRepositories((retries + 1));
|
||||
}
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
Reference in new issue
Block a user