Skip to content

Commit

Permalink
remove unnecessary log and use semantic equality check
Browse files Browse the repository at this point in the history
Signed-off-by: Coleen Iona Quadros <[email protected]>
  • Loading branch information
coleenquadros committed Dec 12, 2024
1 parent 29f521b commit 52a6140
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion operators/multiclusterobservability/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ func ReadImageManifestConfigMap(c client.Client, version string) (map[string]str
}

imageManifests = imageCMList.Items[0].Data
log.V(1).Info("the length of mch-image-manifest configmap", "imageManifests", len(imageManifests))
return imageManifests, true, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ package servicemonitor

import (
"context"
"k8s.io/apimachinery/pkg/api/equality"
"os"
"reflect"
"time"

promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
Expand Down Expand Up @@ -79,7 +79,7 @@ func onUpdate(promClient promclientset.Interface) func(oldObj interface{}, newOb
newSm := newObj.(*promv1.ServiceMonitor)
oldSm := oldObj.(*promv1.ServiceMonitor)
if newSm.ObjectMeta.OwnerReferences != nil && newSm.ObjectMeta.OwnerReferences[0].Kind == "Observatorium" &&
!reflect.DeepEqual(newSm.Spec, oldSm.Spec) {
!equality.Semantic.DeepEqual(newSm.Spec, oldSm.Spec) {
updateServiceMonitor(promClient, newSm)
}
}
Expand Down

0 comments on commit 52a6140

Please sign in to comment.