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:
parent
b31112c36c
commit
1b7dd717a5
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user