mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Respect HTTPS_PROXY for port-forwards
This commit is contained in:
parent
f1a960fd78
commit
e26641688f
@ -21,6 +21,7 @@ export interface PortForwardArgs {
|
|||||||
name: string;
|
name: string;
|
||||||
port: number;
|
port: number;
|
||||||
forwardPort: number;
|
forwardPort: number;
|
||||||
|
httpsProxy?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PortForwardDependencies {
|
export interface PortForwardDependencies {
|
||||||
@ -49,6 +50,7 @@ export class PortForward {
|
|||||||
public name: string;
|
public name: string;
|
||||||
public port: number;
|
public port: number;
|
||||||
public forwardPort: number;
|
public forwardPort: number;
|
||||||
|
public httpsProxy?: string;
|
||||||
|
|
||||||
constructor(private dependencies: PortForwardDependencies, public pathToKubeConfig: string, args: PortForwardArgs) {
|
constructor(private dependencies: PortForwardDependencies, public pathToKubeConfig: string, args: PortForwardArgs) {
|
||||||
this.clusterId = args.clusterId;
|
this.clusterId = args.clusterId;
|
||||||
@ -57,6 +59,7 @@ export class PortForward {
|
|||||||
this.name = args.name;
|
this.name = args.name;
|
||||||
this.port = args.port;
|
this.port = args.port;
|
||||||
this.forwardPort = args.forwardPort;
|
this.forwardPort = args.forwardPort;
|
||||||
|
this.httpsProxy = args.httpsProxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async start() {
|
public async start() {
|
||||||
@ -70,7 +73,10 @@ export class PortForward {
|
|||||||
];
|
];
|
||||||
|
|
||||||
this.process = spawn(kubectlBin, args, {
|
this.process = spawn(kubectlBin, args, {
|
||||||
env: process.env,
|
env: {
|
||||||
|
...process.env,
|
||||||
|
HTTPS_PROXY: this.httpsProxy,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
PortForward.portForwards.push(this);
|
PortForward.portForwards.push(this);
|
||||||
this.process.on("exit", () => {
|
this.process.on("exit", () => {
|
||||||
|
|||||||
@ -35,6 +35,7 @@ const startPortForwardRouteInjectable = getRouteInjectable({
|
|||||||
namespace,
|
namespace,
|
||||||
port,
|
port,
|
||||||
forwardPort,
|
forwardPort,
|
||||||
|
httpsProxy: cluster.preferences.httpsProxy,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!portForward) {
|
if (!portForward) {
|
||||||
@ -54,6 +55,7 @@ const startPortForwardRouteInjectable = getRouteInjectable({
|
|||||||
name: resourceName,
|
name: resourceName,
|
||||||
port,
|
port,
|
||||||
forwardPort: thePort,
|
forwardPort: thePort,
|
||||||
|
httpsProxy: cluster.preferences.httpsProxy,
|
||||||
});
|
});
|
||||||
|
|
||||||
const started = await portForward.start();
|
const started = await portForward.start();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user