Use .constructor(agentOptions)

Signed-off-by: Hung-Han (Henry) Chen <chenhungh@gmail.com>
This commit is contained in:
Hung-Han (Henry) Chen committed 2022-06-07 13:21:46 +08:00
1 parent 44d5b9084b
commit a14f932a65
1 file changed
+2 -5
+2 -5
View File
@@ -170,10 +170,7 @@ export interface IRemoteKubeApiConfig {
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.
* Custom instance of https.agent
*/
agent?: Agent;
}
@@ -248,7 +245,7 @@ export function forRemoteCluster<
}
if (config.agent) {
reqInit.agent = config.agent;
reqInit.agent = config.agent.constructor(agentOptions);
}
const token = config.user.token;