Skip to content

Add an export function for KubeConfigs. Add unit tests too.#372

Merged
k8s-ci-robot merged 1 commit into
kubernetes-client:masterfrom
brendandburns:export
Nov 22, 2019
Merged

Add an export function for KubeConfigs. Add unit tests too.#372
k8s-ci-robot merged 1 commit into
kubernetes-client:masterfrom
brendandburns:export

Conversation

@brendandburns

Copy link
Copy Markdown
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
Copy Markdown
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

Details 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
Comment thread src/config.ts
'current-context': this.getCurrentContext(),
};

return JSON.stringify(configObj);

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

drubin commented Nov 22, 2019

Copy link
Copy Markdown
Contributor

/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