Skip to content

Commit

Permalink
Update kubernetes/eventhandler.go
Browse files Browse the repository at this point in the history
Co-authored-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
  • Loading branch information
gizas and tetianakravchenko authored Jan 9, 2024
1 parent cdfab00 commit 416ab77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kubernetes/eventhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (n *namespacePodUpdater) OnUpdate(obj interface{}) {
slice := n.namespacewatcher.Deltaobjects()
cachednamespaceold, ok := slice[0].(*Namespace)

if ns.Name == cachednamespaceold.Name && ok {
if ok && ns.Name == cachednamespaceold.Name {
labelscheck := checkMetadata(ns.ObjectMeta.Labels, cachednamespaceold.ObjectMeta.Labels)
annotationscheck := checkMetadata(ns.ObjectMeta.Annotations, cachednamespaceold.ObjectMeta.Annotations)
// Only if there is a difference in Metadata labels or annotations proceed to Pod update
Expand Down

0 comments on commit 416ab77

Please sign in to comment.