-
Notifications
You must be signed in to change notification settings - Fork 305
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
Create KubernetesClientConfiguration from pre-loaded K8SConfiguration #213
Conversation
/// <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) |
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.
just naming to make this easier to understand.
public static KubernetesClientConfiguration BuildConfig(K8SConfiguration k8SConfig, string currentContext = null, string masterUrl = null) | |
public static KubernetesClientConfiguration BuildConfigFromCurrent(K8SConfiguration k8SConfig, string currentContext = null, string masterUrl = null) |
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.
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!
/lgtm |
[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 |
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.