Test for and fix crash with nil client in kubelet.

Added test that fails before fix.
Fixed use of nil pointer.
This commit is contained in:
Eric Tune
2015-01-16 13:39:31 -08:00
parent ee0ba6c922
commit 98bdd3f7c4
4 changed files with 18 additions and 4 deletions

View File

@@ -68,6 +68,7 @@ var (
clusterDomain = flag.String("cluster_domain", "", "Domain for this cluster. If set, kubelet will configure all containers to search this domain in addition to the host's search domains")
masterServiceNamespace = flag.String("master_service_namespace", api.NamespaceDefault, "The namespace from which the kubernetes master services should be injected into pods")
clusterDNS = util.IP(nil)
reallyCrashForTesting = flag.Bool("really_crash_for_testing", false, "If true, crash with panics more often.")
)
func init() {
@@ -96,6 +97,7 @@ func setupRunOnce() {
func main() {
util.InitFlags()
util.InitLogs()
util.ReallyCrash = *reallyCrashForTesting
defer util.FlushLogs()
rand.Seed(time.Now().UTC().UnixNano())