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));