Skip to content

Create KubernetesClientConfiguration from pre-loaded K8SConfiguration #213

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

Merged
merged 4 commits into from
Oct 27, 2018

Conversation

itowlson
Copy link
Contributor

Recreates #170 by @markrendle (with Mark's consent, as he does not have bandwidth to update it). From the original description:

"Hi. I'm working on a GUI application that loads the K8SConfiguration, then creates KubernetesClientConfiguration instances based on user selection. Since I've already got the config data loaded, it makes sense to be able to create the client config directly from it, so I've added a new static method BuildConfig that takes the K8SConfiguration instance as a parameter. I guess I could have made the existing GetKubernetesClientConfiguration method public, but I don't like messing with existing API.

Oh, I also fixed up a doc comment that was wrong :)"

And I tweaked a couple more doc comments too.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 22, 2018
/// <param name="k8sConfig">A <see cref="K8SConfiguration"/>, for example loaded from <see cref="LoadKubeConfigAsync(string, bool)" /></param>
/// <param name="currentContext">Override the current context in config, set null if do not want to override</param>
/// <param name="masterUrl">Override the Kubernetes API server endpoint, set null if do not want to override</param>
public static KubernetesClientConfiguration BuildConfig(K8SConfiguration k8SConfig, string currentContext = null, string masterUrl = null)
Copy link
Member

Choose a reason for hiding this comment

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

just naming to make this easier to understand.

Suggested change
public static KubernetesClientConfiguration BuildConfig(K8SConfiguration k8SConfig, string currentContext = null, string masterUrl = null)
public static KubernetesClientConfiguration BuildConfigFromCurrent(K8SConfiguration k8SConfig, string currentContext = null, string masterUrl = null)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good plan. I'm going to propose BuildConfigFromConfigObject to align with ...FromConfigFile and because 'current' doesn't quite describe it. But agree it needs additional qualification - thanks!

@brendandburns
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 27, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns, itowlson

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 27, 2018
@k8s-ci-robot k8s-ci-robot merged commit 7c9cc88 into kubernetes-client:master Oct 27, 2018
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants