mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Handle missing auth file gracefully in kubelet
This commit is contained in:
parent
8025d46cce
commit
b0dd0a8d0b
@ -62,7 +62,11 @@ func (h *delegateHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
func GetAPIServerClient(authPath string, apiServerList util.StringList) (*client.Client, error) {
|
||||
authInfo, err := clientauth.LoadFromFile(authPath)
|
||||
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{})
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user