Skip to content

Commit

Permalink
fix(cni): check that node name exists for both old and new object
Browse files Browse the repository at this point in the history
Signed-off-by: slonka <slonka@users.noreply.github.com>
  • Loading branch information
slonka committed Aug 4, 2022
1 parent 55a9aa8 commit b9c1cf4
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/plugins/runtime/k8s/controllers/cni_taint_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@ func podToNodeMapper(log logr.Logger) kube_handler.MapFunc {
return nil
}

// For some reason in the logs there are a lot of 'could not find a node with name ""'
// so this is why I'm filtering it out here
if pod.Spec.NodeName == "" {
return nil
}

req := kube_reconcile.Request{NamespacedName: kube_types.NamespacedName{
Name: pod.Spec.NodeName,
}}
Expand Down Expand Up @@ -185,7 +179,7 @@ func podEvents(cniApp string) predicate.Funcs {
return filterPods(deleteEvent.Object, cniApp)
},
UpdateFunc: func(updateEvent event.UpdateEvent) bool {
return filterPods(updateEvent.ObjectNew, cniApp)
return filterPods(updateEvent.ObjectNew, cniApp) && filterPods(updateEvent.ObjectOld, cniApp)
},
GenericFunc: func(genericEvent event.GenericEvent) bool {
return false
Expand Down

0 comments on commit b9c1cf4

Please sign in to comment.