Skip to content

Commit

Permalink
use deep equal
Browse files Browse the repository at this point in the history
Signed-off-by: Coleen Iona Quadros <[email protected]>
  • Loading branch information
coleenquadros committed Nov 5, 2024
1 parent 918ce6f commit 97a37dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,12 @@ func GenerateObservatoriumCR(
}
}

if equality.Semantic.DeepDerivative(oldSpec, newSpec) &&
if equality.Semantic.DeepDerivative(newSpec, oldSpec) &&
labels[obsCRConfigHashLabelName] == observatoriumCRFound.Labels[obsCRConfigHashLabelName] {
log.Info("Coleen observatorium CR is up to date")
return nil, nil
}

log.Info("Coleen Updating observatorium CR",
log.Info("Updating observatorium CR",
"observatorium", observatoriumCR.Name,
)

Expand Down Expand Up @@ -722,7 +721,6 @@ func newRuleSpec(mco *mcov1beta2.MultiClusterObservability, scSelected string) o
}

if mcoconfig.HasCustomRuleConfigMap() {
log.Info("Coleen Using custom alert rule config")
customRuleConfig := []obsv1alpha1.RuleConfig{
{
Name: mcoconfig.AlertRuleCustomConfigMapName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func GetConfigMapPredicateFunc() predicate.Funcs {
CreateFunc: func(e event.CreateEvent) bool {
if e.Object.GetNamespace() == config.GetDefaultNamespace() {
if e.Object.GetName() == config.AlertRuleCustomConfigMapName {
log.Info("Coleen AlertRule configmap created")
config.SetCustomRuleConfigMap(true)
return true
} else if _, ok := e.Object.GetLabels()[config.BackupLabelName]; ok {
Expand Down

0 comments on commit 97a37dd

Please sign in to comment.