mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 03:03:40 +00:00
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:
@@ -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())
|
||||
|
||||
|
Reference in New Issue
Block a user