Files
kubernetes/pkg
Kubernetes Submit Queue 9dce773502 Merge pull request #31947 from smarterclayton/check_empty_config
Automatic merge from submit-queue

Check for EmptyConfig errors when trying to use in-cluster config

By removing the default "localhost:8080" behavior several paths in
client config began returning err == ErrEmptyConfig rather than err ==
nil.  The code checking for in cluster config was wrong - the logic
should be:

1. If loading the underlying config returns a non-empty error, fail
2. If the underlying config is not equal to the default config,
   return that config (it has user input)
3. If it is possible to use in-cluster config, do so
4. Otherwise return the default config (and or default EmptyConfig
   error).

Fixes #31910 @thockin @lavalamp @deads2k. We introduced EmptyConfig a very long time ago, but until I removed the "localhost:8080" Kubernetes was not actually exposing it (OpenShift relies on it since we don't set an insecure default). This properly falls through to in-cluster config in the described conditions.



```release-note
Some components like kube-dns and kube-proxy could fail to load the service account token when started within a pod. Properly handle empty configurations to try loading the service account config.
```
2016-09-06 22:02:55 -07:00
..
2016-08-31 13:46:40 -07:00
2016-08-31 13:46:40 -07:00
2016-07-16 13:48:21 -04:00
2016-08-25 10:57:31 -07:00
2016-08-22 14:18:15 -04:00
2016-09-01 15:55:34 -07:00
2016-08-22 12:59:54 -07:00
2016-07-16 13:48:21 -04:00