mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #4003 from ghodss/handle-auth-path-failure
Handle missing auth file gracefully in kubelet
This commit is contained in:
commit
d9f7d39cdb
@ -63,7 +63,11 @@ func (h *delegateHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
|||||||
func GetAPIServerClient(authPath string, apiServerList util.StringList) (*client.Client, error) {
|
func GetAPIServerClient(authPath string, apiServerList util.StringList) (*client.Client, error) {
|
||||||
authInfo, err := clientauth.LoadFromFile(authPath)
|
authInfo, err := clientauth.LoadFromFile(authPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
glog.Warningf("Could not load kubernetes auth path: %v. Continuing with defaults.", err)
|
||||||
|
}
|
||||||
|
if authInfo == nil {
|
||||||
|
// authInfo didn't load correctly - continue with defaults.
|
||||||
|
authInfo = &clientauth.Info{}
|
||||||
}
|
}
|
||||||
clientConfig, err := authInfo.MergeWithConfig(client.Config{})
|
clientConfig, err := authInfo.MergeWithConfig(client.Config{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user