Skip to content
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

Merged
merged 1 commit into from
Nov 22, 2019

Conversation

brendandburns
Copy link
Contributor

Partial fix for #340

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 20, 2019
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 20, 2019
'current-context': this.getCurrentContext(),
};

return JSON.stringify(configObj);
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@drubin
Copy link
Contributor

drubin commented Nov 22, 2019

/lgtm

We can address the other issues or name in another PR?

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 22, 2019
@k8s-ci-robot k8s-ci-robot merged commit d262aff into kubernetes-client:master Nov 22, 2019
@roonie007 roonie007 mentioned this pull request Dec 23, 2019
@brendandburns brendandburns deleted the export branch July 8, 2020 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants