Debug log the node-deletion event

So we know when it came in, also which node.
This commit is contained in:
Bryan Boreham committed 2019-10-11 20:29:58 +00:00
1 parent 30ed34bd2c
commit 3ed7894e39
1 file changed
+7
+7
View File
@@ -259,6 +259,13 @@ func registerForNodeUpdates(client *kubernetes.Clientset, stopCh <-chan struct{}
common.Log.Debugln("registering for updates for node delete events")
nodeInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{
DeleteFunc: func(obj interface{}) {
var name string
if apiObj, ok := obj.(api.Object); ok {
name = apiObj.GetName()
} else {
name = fmt.Sprintf("%#v", obj)
}
common.Log.Debugln("Delete event for", name)
// add random delay to avoid all nodes acting on node delete event at the same
// time leading to contention to use `weave-net` configmap
r := rand.Intn(5000)