mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
adding https_proxy to execHelm env (#5273)
* adding https_proxy to execHelm env Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * lint plus simplification Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
parent
d1ae30a562
commit
ff119dabf7
@ -7,6 +7,7 @@ import { promiseExecFile } from "../../common/utils/promise-exec";
|
|||||||
import type { BaseEncodingOptions } from "fs";
|
import type { BaseEncodingOptions } from "fs";
|
||||||
import type { ExecFileOptions } from "child_process";
|
import type { ExecFileOptions } from "child_process";
|
||||||
import { helmBinaryPath } from "../../common/vars";
|
import { helmBinaryPath } from "../../common/vars";
|
||||||
|
import { UserStore } from "../../common/user-store";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ExecFile the bundled helm CLI
|
* ExecFile the bundled helm CLI
|
||||||
@ -14,7 +15,15 @@ import { helmBinaryPath } from "../../common/vars";
|
|||||||
*/
|
*/
|
||||||
export async function execHelm(args: string[], options?: BaseEncodingOptions & ExecFileOptions): Promise<string> {
|
export async function execHelm(args: string[], options?: BaseEncodingOptions & ExecFileOptions): Promise<string> {
|
||||||
try {
|
try {
|
||||||
const { stdout } = await promiseExecFile(helmBinaryPath.get(), args, options);
|
const opts = { ...options };
|
||||||
|
|
||||||
|
opts.env ??= process.env;
|
||||||
|
|
||||||
|
if (!opts.env.HTTPS_PROXY && UserStore.getInstance().httpsProxy) {
|
||||||
|
opts.env.HTTPS_PROXY = UserStore.getInstance().httpsProxy;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { stdout } = await promiseExecFile(helmBinaryPath.get(), args, opts);
|
||||||
|
|
||||||
return stdout;
|
return stdout;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user