Commit 3c342e22 authored by Erik Wilson's avatar Erik Wilson

Fix panic in node controller

parent 862c7ee3
...@@ -56,11 +56,12 @@ func (h *handler) updateHosts(node *core.Node, removed bool) (*core.Node, error) ...@@ -56,11 +56,12 @@ func (h *handler) updateHosts(node *core.Node, removed bool) (*core.Node, error)
return nil, nil return nil, nil
} }
configMap, err := h.configCache.Get("kube-system", "coredns") configMapCache, err := h.configCache.Get("kube-system", "coredns")
if err != nil || configMap == nil { if err != nil || configMapCache == nil {
logrus.Warn(errors.Wrap(err, "Unable to fetch coredns config map")) logrus.Warn(errors.Wrap(err, "Unable to fetch coredns config map"))
return nil, nil return nil, nil
} }
configMap := configMapCache.DeepCopy()
hosts := configMap.Data["NodeHosts"] hosts := configMap.Data["NodeHosts"]
for _, line := range strings.Split(hosts, "\n") { for _, line := range strings.Split(hosts, "\n") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment