From 2d73a987b32f9eac148ce4987040185db9f84901 Mon Sep 17 00:00:00 2001 From: Andrew Gizas Date: Tue, 9 Jan 2024 15:19:08 +0200 Subject: [PATCH 1/3] Update kubernetes/eventhandler.go Co-authored-by: Tetiana Kravchenko --- kubernetes/eventhandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/eventhandler.go b/kubernetes/eventhandler.go index 863590ac2..bda153674 100644 --- a/kubernetes/eventhandler.go +++ b/kubernetes/eventhandler.go @@ -245,7 +245,7 @@ func (n *nodePodUpdater) OnUpdate(obj interface{}) { if ok && node.Name == cachednodeold.Name { labelscheck := isEqualMetadata(node.ObjectMeta.Labels, cachednodeold.ObjectMeta.Labels) annotationscheck := isEqualMetadata(node.ObjectMeta.Annotations, cachednodeold.ObjectMeta.Annotations) - // Only if there is a diffrence in Metadata labels or annotations proceed to Pod update + // Only if there is a difference in Metadata labels or annotations proceed to Pod update if !labelscheck || !annotationscheck { for _, pod := range n.store.List() { pod, ok := pod.(*Pod) From 76b4dce466607616f80db431437d17b9eacdc70c Mon Sep 17 00:00:00 2001 From: Andrew Gizas Date: Tue, 9 Jan 2024 16:25:55 +0200 Subject: [PATCH 2/3] Update kubernetes/eventhandler.go Co-authored-by: Giuseppe Santoro --- kubernetes/eventhandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/eventhandler.go b/kubernetes/eventhandler.go index bda153674..296b77255 100644 --- a/kubernetes/eventhandler.go +++ b/kubernetes/eventhandler.go @@ -265,7 +265,7 @@ func (*nodePodUpdater) OnAdd(interface{}) {} // namespace they will generate their own delete events. func (*nodePodUpdater) OnDelete(interface{}) {} -// isEqualMetadata receives labels or annotations maps and checks their equality. Returns True if equal, False if there is a diffrence +// isEqualMetadata receives labels or annotations maps and checks their equality. Returns True if equal, False if there is a difference func isEqualMetadata(newmetadata, oldmetadata map[string]string) bool { check := reflect.DeepEqual(newmetadata, oldmetadata) return check From 66f616c494535ba2d49632ac58e8b33f6a651efd Mon Sep 17 00:00:00 2001 From: Andrew Gizas Date: Tue, 9 Jan 2024 16:26:59 +0200 Subject: [PATCH 3/3] Update kubernetes/watcher.go Co-authored-by: Giuseppe Santoro --- kubernetes/watcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/watcher.go b/kubernetes/watcher.go index cd786a42a..fe8b7ee92 100644 --- a/kubernetes/watcher.go +++ b/kubernetes/watcher.go @@ -232,7 +232,7 @@ func (w *watcher) enqueue(obj interface{}, state string) { // oldobjectreturn returns the old version of cache objects before change on update events func (w *watcher) oldobjectreturn(o interface{}) { if old, ok := o.(runtime.Object); !ok { - utilruntime.HandleError(fmt.Errorf("expected object in cache got %#v", o)) + utilruntime.HandleError(fmt.Errorf("expected object in cache got %#v", o)) } else { w.oldobject = old }