Skip to content

Commit

Permalink
NETOBSERV-1076 Fix service change detection (#360)
Browse files Browse the repository at this point in the history
use DeepDerivative on labels & annotations only, rather than full
ObjectMeta
  • Loading branch information
jotak authored Jun 2, 2023
1 parent 0e4dfd1 commit 6aa0188
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/helper/comparators.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ func probeChanged(old, new *corev1.Probe) bool {
}

func ServiceChanged(old, new *corev1.Service, report *ChangeReport) bool {
return report.Check("Service meta changed", !equality.Semantic.DeepDerivative(new.ObjectMeta, old.ObjectMeta)) ||
return report.Check("Service annotations changed", !equality.Semantic.DeepDerivative(new.Annotations, old.Annotations)) ||
report.Check("Service labels changed", !equality.Semantic.DeepDerivative(new.Labels, old.Labels)) ||
report.Check("Service spec changed", !equality.Semantic.DeepDerivative(new.Spec, old.Spec))
}

Expand Down

0 comments on commit 6aa0188

Please sign in to comment.