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 DetailsNeeds 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.
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.
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.
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