-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
allow any number of kubeconfig files #5541
allow any number of kubeconfig files #5541
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA) at https://cla.developers.google.com/. If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check the information on your CLA or see this help article on setting the email on your git commits. Once you've done that, please reply here to let us know. If you signed the CLA as a corporation, please let us know the company's name. |
@smarterclayton This is what @fabianofranz wanted for openshift/origin#992. It makes extension of loading order to allow more files possible. |
@@ -33,31 +33,35 @@ import ( | |||
const ( | |||
RecommendedConfigPathFlag = "kubeconfig" | |||
RecommendedConfigPathEnvVar = "KUBECONFIG" |
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.
Recommended* consts for the file names in local and home dirs (.kubeconfig
and /.kube/.kubeconfig
)?
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.
Recommended* consts for the file names in local and home dirs (.kubeconfig and /.kube/.kubeconfig)?
I'd prefer not to do that in this pull. The location of the files isn't necessarily fixed. #4615 proposes new locations (for good reasons) and #4428 proposes changes as well. I don't think we've closed on a recommended location or even whether that location is a file or directory.
2 comments otherwise LGTM. |
Seems reasonable to me. |
allow any number of kubeconfig files
Restricting .kubeconfig files to only four locations made it see exactly where files were coming from, but it made extending the mechanism just about impossible. This allows a separate precedence order slice that allows easy extensions.
ExplicitPath
(previouslyCommandLinePath
) is special and still called out because if theExplicitPath
is set, the referenced file must be present. Missing files in the rest of the precedence order are simply ignored.