-
Notifications
You must be signed in to change notification settings - Fork 1.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
config: fix using the KUBECONFIG to build the client #84
config: fix using the KUBECONFIG to build the client #84
Conversation
/lgtm |
@sjenning: changing LGTM is restricted to assignees, and only kubernetes-sigs/controller-runtime repo collaborators may be assigned issues. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
approve bot might be borked right now, need to check. |
/approve |
…nfig config: fix using the KUBECONFIG to build the client
disable git validation during release process
There appears to be a regression error here. In the master branch the code seem to have been changed back to exactly what this PR fixed initially. Is that right? Master branch: https://github.com/rphillips/controller-runtime/blob/master/pkg/client/config/config.go func GetConfig() (*rest.Config, error) {
if len(kubeconfig) > 0 {
return clientcmd.BuildConfigFromFlags(masterURL, kubeconfig)
}
if len(os.Getenv("KUBECONFIG")) > 0 {
// HERE we have kubeconfig instead of os.Getenv("KUBECONFIG") again
return clientcmd.BuildConfigFromFlags(masterURL, kubeconfig)
}
if c, err := rest.InClusterConfig(); err == nil {
return c, nil
}
if usr, err := user.Current(); err == nil {
if c, err := clientcmd.BuildConfigFromFlags(
"", filepath.Join(usr.HomeDir, ".kube", "config")); err == nil {
return c, nil
}
}
return nil, fmt.Errorf("could not locate a kubeconfig")
} Also, does it make sense to call |
There is no master branch anymore on the upstream repository. And the code on the main branch looks different (looks like what you linked is 5 years old) |
Oh my god, I'm so sorry. I swear to god I was looking at the upstream kubernetes-sigs repo. My bad. Too many tabs open! |
No problem. IIRC GitHub also has some magic feature that sometimes redirects you to a fork if something doesn't exist on the main repo (I don't remember when exactly) |
Fix passing the kubeconfig to the client factory.