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

Commit a31d128

Browse files
Seokju HongAndres Martinez Gotor
Seokju Hong
authored and
Andres Martinez Gotor
committed
Pass AWS_PROFILE value as an environment variable (#196)
1 parent 0658dc2 commit a31d128

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/helpers.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,16 @@ function getToken(userInfo) {
126126
cmd = `${cmd} ${args.join(' ')}`;
127127
}
128128
const env = _.get(userInfo, 'user.exec.env', []);
129+
const envvars = Object.assign({}, process.env);
129130
if (env) {
130131
const profile = _.find(env, e => e.name === 'AWS_PROFILE');
131132
if (profile) {
132-
cmd = `${cmd} --profile ${profile.value}`;
133+
envvars.AWS_PROFILE = profile.value;
133134
}
134135
}
135136
let output = {};
136137
try {
137-
output = proc.execSync(cmd);
138+
output = proc.execSync(cmd, envvars);
138139
} catch (err) {
139140
throw new Error(`Failed to refresh token: ${err.message}`);
140141
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-kubeless",
3-
"version": "0.9.0",
3+
"version": "0.9.1",
44
"description": "This plugin enables support for Kubeless within the [Serverless Framework](https://github.com/serverless).",
55
"main": "index.js",
66
"directories": {

0 commit comments

Comments
 (0)