Respect HTTPS_PROXY for port-forwards

This commit is contained in:
Phillip LeBlanc committed 2023-09-01 19:39:23 +09:00
1 parent f1a960fd78
commit e26641688f
2 files changed
+9 -1

No files matched your search

@@ -21,6 +21,7 @@ export interface PortForwardArgs {
name: string;
port: number;
forwardPort: number;
httpsProxy?: string;
}
export interface PortForwardDependencies {
@@ -49,6 +50,7 @@ export class PortForward {
public name: string;
public port: number;
public forwardPort: number;
public httpsProxy?: string;
constructor(private dependencies: PortForwardDependencies, public pathToKubeConfig: string, args: PortForwardArgs) {
this.clusterId = args.clusterId;
@@ -57,6 +59,7 @@ export class PortForward {
this.name = args.name;
this.port = args.port;
this.forwardPort = args.forwardPort;
this.httpsProxy = args.httpsProxy;
}
public async start() {
@@ -70,7 +73,10 @@ export class PortForward {
];
this.process = spawn(kubectlBin, args, {
env: process.env,
env: {
...process.env,
HTTPS_PROXY: this.httpsProxy,
},
});
PortForward.portForwards.push(this);
this.process.on("exit", () => {
@@ -35,6 +35,7 @@ const startPortForwardRouteInjectable = getRouteInjectable({
namespace,
port,
forwardPort,
httpsProxy: cluster.preferences.httpsProxy,
});
if (!portForward) {
@@ -54,6 +55,7 @@ const startPortForwardRouteInjectable = getRouteInjectable({
name: resourceName,
port,
forwardPort: thePort,
httpsProxy: cluster.preferences.httpsProxy,
});
const started = await portForward.start();