1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Allow using custom https.Agent instance (#5564)

* Allow using custom https.Agent instance

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>

* Use .constructor(agentOptions)

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>

* Revert

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
chh 2022-06-07 20:06:58 +08:00 committed by GitHub
parent b31112c36c
commit 1b7dd717a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,6 +169,13 @@ export interface IRemoteKubeApiConfig {
clientCertificateData?: string;
clientKeyData?: string;
};
/**
* Custom instance of https.agent to use for the requests
*
* @remarks the custom agent replaced default agent, options skipTLSVerify,
* clientCertificateData, clientKeyData and caData are ignored.
*/
agent?: Agent;
}
export function forCluster<
@ -240,6 +247,10 @@ export function forRemoteCluster<
reqInit.agent = new Agent(agentOptions);
}
if (config.agent) {
reqInit.agent = config.agent;
}
const token = config.user.token;
const request = new KubeJsonApi({
serverAddress: config.cluster.server,