Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit 06ed262

Browse files
author
Cyril Scetbon
authored
Attach env vars from kube config when renewing token (#209)
1 parent 0b62c54 commit 06ed262

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/helpers.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,13 @@ function getToken(userInfo) {
128128
const env = _.get(userInfo, 'user.exec.env', []);
129129
const envvars = Object.assign({}, process.env);
130130
if (env) {
131-
const profile = _.find(env, e => e.name === 'AWS_PROFILE');
132-
if (profile) {
133-
envvars.AWS_PROFILE = profile.value;
131+
for (const envvar of env) {
132+
envvars[envvar.name] = envvar.value || '';
134133
}
135134
}
136135
let output = {};
137136
try {
138-
output = proc.execSync(cmd, envvars);
137+
output = proc.execSync(cmd, { env: envvars });
139138
} catch (err) {
140139
throw new Error(`Failed to refresh token: ${err.message}`);
141140
}

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)