Incorrect cached token fetched with multiple kubeconfigs · Issue #592 · kubernetes-client/javascript (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@sheldonkwok

Description

@sheldonkwok

When using multiple kubeconfig files with the same user.name field, the kubeconfig user that is fetched first for execAuth will be used for all subsequent users that match the same name.

The issue arises here.
https://github.com/kubernetes-client/javascript/blob/master/src/exec_auth.ts#L74

I'm not sure if it's an antipattern to use multiple kubeconfigs but maybe we could document this if we don't want to fix it. Having different user names is easy enough. We could also hash the whole user object to cache instead of the name. I can implement this solution or another proposed solution if we want to address this.