diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go index 912ffb015..0cc5d1a8e 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go @@ -161,20 +161,22 @@ func GenerateObservatoriumCR( oldSpec := observatoriumCRFound.Spec newSpec := observatoriumCR.Spec - oldSpecBytes, _ := yaml.Marshal(oldSpec) - newSpecBytes, _ := yaml.Marshal(newSpec) - if bytes.Equal(newSpecBytes, oldSpecBytes) && - labels[obsCRConfigHashLabelName] == observatoriumCRFound.Labels[obsCRConfigHashLabelName] { - return nil, nil - } - // keep the tenant id unchanged + // keep the tenant id unchanged and ensure the new spec has the same tenant ID as the old spec to prevent Observatorium + // from updating for i, newTenant := range newSpec.API.Tenants { for _, oldTenant := range oldSpec.API.Tenants { updateTenantID(&newSpec, newTenant, oldTenant, i) } } + oldSpecBytes, _ := yaml.Marshal(oldSpec) + newSpecBytes, _ := yaml.Marshal(newSpec) + if bytes.Equal(newSpecBytes, oldSpecBytes) && + labels[obsCRConfigHashLabelName] == observatoriumCRFound.Labels[obsCRConfigHashLabelName] { + return nil, nil + } + log.Info("Updating observatorium CR", "observatorium", observatoriumCR.Name, )