diff --git a/lib/helpers.js b/lib/helpers.js index f44f645..70cb854 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -126,15 +126,16 @@ function getToken(userInfo) { cmd = `${cmd} ${args.join(' ')}`; } const env = _.get(userInfo, 'user.exec.env', []); + const envvars = Object.assign({}, process.env); if (env) { const profile = _.find(env, e => e.name === 'AWS_PROFILE'); if (profile) { - cmd = `${cmd} --profile ${profile.value}`; + envvars.AWS_PROFILE = profile.value; } } let output = {}; try { - output = proc.execSync(cmd); + output = proc.execSync(cmd, envvars); } catch (err) { throw new Error(`Failed to refresh token: ${err.message}`); } diff --git a/package.json b/package.json index e2b75db..29e69d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "serverless-kubeless", - "version": "0.9.0", + "version": "0.9.1", "description": "This plugin enables support for Kubeless within the [Serverless Framework](https://github.com/serverless).", "main": "index.js", "directories": {