-
Notifications
You must be signed in to change notification settings - Fork 539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an export function for KubeConfigs. Add unit tests too. #372
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
'current-context': this.getCurrentContext(), | ||
}; | ||
|
||
return JSON.stringify(configObj); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we are exporting the data as json and not an object? Just wondering if people would want the json or maybe rather use yaml?
I didn't look at the go implementation though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON is valid YAML :)
The purpose of this is to serialize it to a string. I can change the name to 'SerializeConfig' if that's clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I totally forgot.
I was just thinking most people would use this to write their kubeconfig which is currently in yaml
and if their intention was to convert it to yaml
to be human-readable they would need to parse this and then convert it anyway.
/lgtm We can address the other issues or name in another PR? |
Partial fix for #340