From b3ff0b6ac908a38e27a5d6ca5cca8984b545975f Mon Sep 17 00:00:00 2001 From: Prashant Farkya Date: Mon, 23 Jun 2025 20:06:05 +0530 Subject: [PATCH] FIX: Adding support for multiple client --- src/config.ts | 4 ++-- src/config_test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.ts b/src/config.ts index 526ce20861..6c0dd335c4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -58,7 +58,7 @@ function fileExists(filepath: string): boolean { export interface ApiType {} export class KubeConfig implements SecurityAuthentication { - private static authenticators: Authenticator[] = [ + private authenticators: Authenticator[] = [ new AzureAuth(), new GoogleCloudPlatformAuth(), new ExecAuth(), @@ -596,7 +596,7 @@ export class KubeConfig implements SecurityAuthentication { if (!user) { return; } - let authenticator = KubeConfig.authenticators.find((elt: Authenticator) => { + let authenticator = this.authenticators.find((elt: Authenticator) => { return elt.isAuthProvider(user); }); diff --git a/src/config_test.ts b/src/config_test.ts index ea8e4e2dc1..96e126a09b 100644 --- a/src/config_test.ts +++ b/src/config_test.ts @@ -1345,7 +1345,7 @@ describe('KubeConfig', () => { // TODO: inject the exec command here? const opts = {} as RequestOptions; await config.applyToHTTPSOptions(opts); - const execAuthenticator = (KubeConfig as any).authenticators.find( + const execAuthenticator = (config as any).authenticators.find( (authenticator) => authenticator instanceof ExecAuth, ); deepStrictEqual(execAuthenticator.tokenCache.exec, JSON.parse(responseStr));