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

Conversation

@bradleybluebean
Copy link
Contributor

AWS EKS utilizes the kubeconfig support for client-go credential plugins to execute the aws CLI command to receive user credentials when authenticating to an EKS cluster. This PR adds support to serverless-kubeless to use such configs as another access token mechanism and should address issue #140

(Thanks to the Javascript Kubernetes Client cloud_auth for the general idea of how to do this.)

Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, thanks for the PR! I have just a couple of small comments.

Apart from that, can you bump the version of the package to do the release?

lib/helpers.js Outdated
if (args) {
cmd = `${cmd} ${args.join(' ')}`;
}
const profile = _.find(userInfo.user.exec.env, e => e.name === 'AWS_PROFILE');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if userInfo.user.exec is undefined this will crash, you can try:

const env = _.get(userInfo, 'user.exec.env', []);
const profile = ...

lib/helpers.js Outdated
throw new Error(`Failed to refresh token: ${err.message}`);
}
const resultObj = JSON.parse(output);
return resultObj.status.token;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I would also verify that status is defined

@bradleybluebean
Copy link
Contributor Author

Thanks for the feedback @andresmgot. Let me know if this is not what you had in mind.

Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants