From 3899bfe3fe453d14ff4744782ad1549a7d80ab6a Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Thu, 7 Nov 2024 15:08:27 +0100 Subject: [PATCH 01/17] update comp (#1660) Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- COMPONENT_VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/COMPONENT_VERSION b/COMPONENT_VERSION index 3ca2c9b2c..fb2c0766b 100644 --- a/COMPONENT_VERSION +++ b/COMPONENT_VERSION @@ -1 +1 @@ -2.12.0 \ No newline at end of file +2.13.0 From 59c893e50fb7d9bb292b224549959cf0b6fd291f Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Thu, 24 Oct 2024 17:38:11 +0200 Subject: [PATCH 02/17] fix spec comaprison for observatorium Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- .../controllers/multiclusterobservability/observatorium.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go index 1c414cc6b..979444407 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go @@ -5,8 +5,8 @@ package multiclusterobservability import ( - "bytes" "context" + "k8s.io/apimachinery/pkg/api/equality" // The import of crypto/md5 below is not for cryptographic use. It is used to hash the contents of files to track // changes and thus it's not a security issue. @@ -170,9 +170,7 @@ func GenerateObservatoriumCR( } } - oldSpecBytes, _ := yaml.Marshal(oldSpec) - newSpecBytes, _ := yaml.Marshal(newSpec) - if bytes.Equal(newSpecBytes, oldSpecBytes) && + if equality.Semantic.DeepDerivative(oldSpec, newSpec) && labels[obsCRConfigHashLabelName] == observatoriumCRFound.Labels[obsCRConfigHashLabelName] { return nil, nil } From 4c1fa60541dec09585e516f854d7f189ff5b9fe4 Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Thu, 24 Oct 2024 17:42:12 +0200 Subject: [PATCH 03/17] lint Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- .../controllers/multiclusterobservability/observatorium.go | 1 + 1 file changed, 1 insertion(+) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go index 979444407..5063fb1fb 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go @@ -6,6 +6,7 @@ package multiclusterobservability import ( "context" + "k8s.io/apimachinery/pkg/api/equality" // The import of crypto/md5 below is not for cryptographic use. It is used to hash the contents of files to track From 98f276b0022ad6961977a2f4a6711188add0dc33 Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Thu, 24 Oct 2024 20:28:08 +0200 Subject: [PATCH 04/17] add test Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- .../observatorium_test.go | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium_test.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium_test.go index a38d06d71..19d250166 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium_test.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium_test.go @@ -11,6 +11,8 @@ import ( "reflect" "testing" + "k8s.io/apimachinery/pkg/api/equality" + routev1 "github.com/openshift/api/route/v1" mcoshared "github.com/stolostron/multicluster-observability-operator/operators/multiclusterobservability/api/shared" @@ -318,10 +320,24 @@ func TestUpdateObservatoriumCR(t *testing.T) { t.Errorf("config-hash label contains unexpected hash. Want: '%s', got '%s'", expectedConfigHash, updatedHash) } - createdSpecBytes, _ := yaml.Marshal(createdObservatoriumCR.Spec) - updatedSpecBytes, _ := yaml.Marshal(updatedObservatorium.Spec) - if res := bytes.Compare(updatedSpecBytes, createdSpecBytes); res != 0 { - t.Errorf("%v should be equal to %v", string(createdSpecBytes), string(updatedSpecBytes)) + if !equality.Semantic.DeepDerivative(updatedObservatorium.Spec, createdObservatoriumCR.Spec) { + t.Errorf("updated observatorium CR spec is not equal to the created one") + } + + // Test Observaotrium CR gets updated with new update from MCO + mco.Spec.StorageConfig.CompactStorageSize = "2Gi" + _, err = GenerateObservatoriumCR(cl, s, mco) + if err != nil { + t.Errorf("Failed to update observatorium due to %v", err) + } + updatedObservatorium = &observatoriumv1alpha1.Observatorium{} + cl.Get(context.TODO(), types.NamespacedName{ + Name: mcoconfig.GetDefaultCRName(), + Namespace: namespace, + }, updatedObservatorium) + + if updatedObservatorium.Spec.Thanos.Compact.VolumeClaimTemplate.Spec.Resources.Requests.Storage().String() != "2Gi" { + t.Errorf("Failed to update observatorium CR with new compact storage size") } } From 99b57ca3174a186b6c1cebb58e89aad769206c11 Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Mon, 4 Nov 2024 11:50:14 +0100 Subject: [PATCH 05/17] run only alert Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- cicd-scripts/customize-mco.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cicd-scripts/customize-mco.sh b/cicd-scripts/customize-mco.sh index 1a6051f27..a77a59541 100755 --- a/cicd-scripts/customize-mco.sh +++ b/cicd-scripts/customize-mco.sh @@ -119,9 +119,9 @@ get_changed_components() { get_ginkgo_focus() { if [[ -n ${IS_KIND_ENV} ]]; then # For KinD cluster, do not need to run all test cases - GINKGO_FOCUS=" --focus manifestwork/g0 --focus endpoint_preserve/g0 --focus grafana/g0 --focus metrics/g0 --focus addon/g0 --focus alert/g0 --focus dashboard/g0" + GINKGO_FOCUS=" --focus alert/g0" else - GINKGO_FOCUS="" + GINKGO_FOCUS=" --focus alert/g0" fi echo "Test focuses are ${GINKGO_FOCUS}" } From 3a272c4c188a2542a2030bc46dc54402a8e21c64 Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Mon, 4 Nov 2024 13:40:03 +0100 Subject: [PATCH 06/17] test Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- tests/pkg/tests/observability_install_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pkg/tests/observability_install_test.go b/tests/pkg/tests/observability_install_test.go index 485196ba3..3c3710a92 100644 --- a/tests/pkg/tests/observability_install_test.go +++ b/tests/pkg/tests/observability_install_test.go @@ -52,7 +52,7 @@ func installMCO() { Expect(string(pod.Status.Phase)).To(Equal("Running")) } - By("Checking Required CRDs are created") + By("Checking Required CRDs are created test") Eventually(func() error { return utils.HaveCRDs(testOptions.HubCluster, testOptions.KubeConfig, []string{ From a5e8dc84cc41546807a84f18d57e9745e9c878ea Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Tue, 5 Nov 2024 10:27:37 +0100 Subject: [PATCH 07/17] add logs Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- .../controllers/multiclusterobservability/observatorium.go | 4 +++- .../controllers/multiclusterobservability/predicate_func.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go index 5063fb1fb..81b6d753e 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go @@ -173,10 +173,11 @@ func GenerateObservatoriumCR( if equality.Semantic.DeepDerivative(oldSpec, newSpec) && labels[obsCRConfigHashLabelName] == observatoriumCRFound.Labels[obsCRConfigHashLabelName] { + log.Info("Coleen observatorium CR is up to date") return nil, nil } - log.Info("Updating observatorium CR", + log.Info("Coleen Updating observatorium CR", "observatorium", observatoriumCR.Name, ) @@ -721,6 +722,7 @@ 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, diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/predicate_func.go b/operators/multiclusterobservability/controllers/multiclusterobservability/predicate_func.go index e572ec142..940c88d8e 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/predicate_func.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/predicate_func.go @@ -37,6 +37,7 @@ 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 { From e6250b372e1ad4a54e384c3ba2e2ad6cea1eface Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Tue, 5 Nov 2024 11:08:18 +0100 Subject: [PATCH 08/17] use deep equal Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- .../controllers/multiclusterobservability/observatorium.go | 6 ++---- .../controllers/multiclusterobservability/predicate_func.go | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go index 81b6d753e..f1ab4c09c 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go @@ -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, ) @@ -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, diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/predicate_func.go b/operators/multiclusterobservability/controllers/multiclusterobservability/predicate_func.go index 940c88d8e..e572ec142 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/predicate_func.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/predicate_func.go @@ -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 { From 4288b4a77caa53275901ab89dda89fd6616f1f12 Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Tue, 5 Nov 2024 12:37:41 +0100 Subject: [PATCH 09/17] logs Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- .../controllers/multiclusterobservability/observatorium.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go index f1ab4c09c..08f3b4c8b 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go @@ -163,6 +163,9 @@ func GenerateObservatoriumCR( oldSpec := observatoriumCRFound.Spec newSpec := observatoriumCR.Spec + log.Info("Coleen oldSpec", "oldSpec", oldSpec) + log.Info("Coleen newSpec", "newSpec", newSpec) + // 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 { From 7d04c1c4d28379d9ed2c468b3a45870cd1524369 Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Tue, 5 Nov 2024 16:19:06 +0100 Subject: [PATCH 10/17] dont reply on global var for customr rules cm check Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- .../observatorium.go | 31 ++++++++++--------- .../predicate_func.go | 2 -- .../pkg/config/config.go | 10 ------ 3 files changed, 17 insertions(+), 26 deletions(-) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go index 08f3b4c8b..9a2e6da40 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go @@ -6,6 +6,7 @@ package multiclusterobservability import ( "context" + corev1 "k8s.io/client-go/applyconfigurations/core/v1" "k8s.io/apimachinery/pkg/api/equality" @@ -163,8 +164,8 @@ func GenerateObservatoriumCR( oldSpec := observatoriumCRFound.Spec newSpec := observatoriumCR.Spec - log.Info("Coleen oldSpec", "oldSpec", oldSpec) - log.Info("Coleen newSpec", "newSpec", newSpec) + log.Info("Coleen oldSpec", "oldSpec", oldSpec.Thanos.Rule.RulesConfig) + log.Info("Coleen newSpec", "newSpec", newSpec.Thanos.Rule.RulesConfig) // keep the tenant id unchanged and ensure the new spec has the same tenant ID as the old spec to prevent Observatorium // from updating @@ -351,7 +352,7 @@ func newDefaultObservatoriumSpec(cl client.Client, mco *mcov1beta2.MultiClusterO return obs, err } obs.API = obsApi - obs.Thanos = newThanosSpec(mco, scSelected) + obs.Thanos = newThanosSpec(cl, mco, scSelected) if util.ProxyEnvVarsAreSet() { obs.EnvVars = newEnvVars() } @@ -649,7 +650,7 @@ func newReceiversSpec( return receSpec } -func newRuleSpec(mco *mcov1beta2.MultiClusterObservability, scSelected string) obsv1alpha1.RuleSpec { +func newRuleSpec(cl client.Client, mco *mcov1beta2.MultiClusterObservability, scSelected string) obsv1alpha1.RuleSpec { ruleSpec := obsv1alpha1.RuleSpec{} if mco.Spec.AdvancedConfig != nil && mco.Spec.AdvancedConfig.RetentionConfig != nil && mco.Spec.AdvancedConfig.RetentionConfig.BlockDuration != "" { @@ -723,7 +724,16 @@ func newRuleSpec(mco *mcov1beta2.MultiClusterObservability, scSelected string) o }, } - if mcoconfig.HasCustomRuleConfigMap() { + if err := cl.Get(context.TODO(), types.NamespacedName{Name: mcoconfig.AlertRuleCustomConfigMapName, Namespace: mcoconfig.GetDefaultNamespace()}, &corev1.ConfigMap{}); err != nil { + if k8serrors.IsNotFound(err) { + ruleSpec.RulesConfig = []obsv1alpha1.RuleConfig{ + { + Name: mcoconfig.AlertRuleDefaultConfigMapName, + Key: mcoconfig.AlertRuleDefaultFileKey, + }, + } + } + } else { customRuleConfig := []obsv1alpha1.RuleConfig{ { Name: mcoconfig.AlertRuleCustomConfigMapName, @@ -731,13 +741,6 @@ func newRuleSpec(mco *mcov1beta2.MultiClusterObservability, scSelected string) o }, } ruleSpec.RulesConfig = append(ruleSpec.RulesConfig, customRuleConfig...) - } else { - ruleSpec.RulesConfig = []obsv1alpha1.RuleConfig{ - { - Name: mcoconfig.AlertRuleDefaultConfigMapName, - Key: mcoconfig.AlertRuleDefaultFileKey, - }, - } } if mco.Spec.AdvancedConfig != nil && mco.Spec.AdvancedConfig.Rule != nil && @@ -834,14 +837,14 @@ func newMemCacheSpec(component string, mco *mcov1beta2.MultiClusterObservability return memCacheSpec } -func newThanosSpec(mco *mcov1beta2.MultiClusterObservability, scSelected string) obsv1alpha1.ThanosSpec { +func newThanosSpec(c client.Client, mco *mcov1beta2.MultiClusterObservability, scSelected string) obsv1alpha1.ThanosSpec { thanosSpec := obsv1alpha1.ThanosSpec{} thanosSpec.Image = mcoconfig.DefaultImgRepository + "/" + mcoconfig.ThanosImgName + ":" + mcoconfig.DefaultImgTagSuffix thanosSpec.Compact = newCompactSpec(mco, scSelected) thanosSpec.Receivers = newReceiversSpec(mco, scSelected) - thanosSpec.Rule = newRuleSpec(mco, scSelected) + thanosSpec.Rule = newRuleSpec(cl, mco, scSelected) thanosSpec.Store = newStoreSpec(mco, scSelected) thanosSpec.ReceiveController = newReceiverControllerSpec(mco) thanosSpec.Query = newQuerySpec(mco) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/predicate_func.go b/operators/multiclusterobservability/controllers/multiclusterobservability/predicate_func.go index e572ec142..2b85e5ef0 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/predicate_func.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/predicate_func.go @@ -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 { - config.SetCustomRuleConfigMap(true) return true } else if _, ok := e.Object.GetLabels()[config.BackupLabelName]; ok { // resource already has backup label @@ -78,7 +77,6 @@ func GetConfigMapPredicateFunc() predicate.Funcs { DeleteFunc: func(e event.DeleteEvent) bool { if e.Object.GetName() == config.AlertRuleCustomConfigMapName && e.Object.GetNamespace() == config.GetDefaultNamespace() { - config.SetCustomRuleConfigMap(false) return true } return false diff --git a/operators/multiclusterobservability/pkg/config/config.go b/operators/multiclusterobservability/pkg/config/config.go index 5c8443544..e15950600 100644 --- a/operators/multiclusterobservability/pkg/config/config.go +++ b/operators/multiclusterobservability/pkg/config/config.go @@ -647,16 +647,6 @@ func GetObsAPISvc(instanceName string) string { return instanceName + "-observatorium-api." + defaultNamespace + ".svc.cluster.local" } -// SetCustomRuleConfigMap set true if there is custom rule configmap. -func SetCustomRuleConfigMap(hasConfigMap bool) { - hasCustomRuleConfigMap = hasConfigMap -} - -// HasCustomRuleConfigMap returns true if there is custom rule configmap. -func HasCustomRuleConfigMap() bool { - return hasCustomRuleConfigMap -} - func GetCertDuration() time.Duration { return certDuration } From da49526ac6cae893134dba0155469c068007da1b Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Tue, 5 Nov 2024 16:22:56 +0100 Subject: [PATCH 11/17] lib Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- .../controllers/multiclusterobservability/observatorium.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go index 9a2e6da40..ae7192af2 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go @@ -6,8 +6,8 @@ package multiclusterobservability import ( "context" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" // The import of crypto/md5 below is not for cryptographic use. It is used to hash the contents of files to track @@ -837,7 +837,7 @@ func newMemCacheSpec(component string, mco *mcov1beta2.MultiClusterObservability return memCacheSpec } -func newThanosSpec(c client.Client, mco *mcov1beta2.MultiClusterObservability, scSelected string) obsv1alpha1.ThanosSpec { +func newThanosSpec(cl client.Client, mco *mcov1beta2.MultiClusterObservability, scSelected string) obsv1alpha1.ThanosSpec { thanosSpec := obsv1alpha1.ThanosSpec{} thanosSpec.Image = mcoconfig.DefaultImgRepository + "/" + mcoconfig.ThanosImgName + ":" + mcoconfig.DefaultImgTagSuffix From 1fcb0201ebb69b77f63278cd24b1f50362ebab51 Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Tue, 5 Nov 2024 16:40:28 +0100 Subject: [PATCH 12/17] remove ginkgo focus Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- cicd-scripts/customize-mco.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cicd-scripts/customize-mco.sh b/cicd-scripts/customize-mco.sh index a77a59541..1a6051f27 100755 --- a/cicd-scripts/customize-mco.sh +++ b/cicd-scripts/customize-mco.sh @@ -119,9 +119,9 @@ get_changed_components() { get_ginkgo_focus() { if [[ -n ${IS_KIND_ENV} ]]; then # For KinD cluster, do not need to run all test cases - GINKGO_FOCUS=" --focus alert/g0" + GINKGO_FOCUS=" --focus manifestwork/g0 --focus endpoint_preserve/g0 --focus grafana/g0 --focus metrics/g0 --focus addon/g0 --focus alert/g0 --focus dashboard/g0" else - GINKGO_FOCUS=" --focus alert/g0" + GINKGO_FOCUS="" fi echo "Test focuses are ${GINKGO_FOCUS}" } From a8aea6c28790bab5b9697d844159f847c77ad478 Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Tue, 5 Nov 2024 16:58:08 +0100 Subject: [PATCH 13/17] remove ginkgo focus Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- operators/multiclusterobservability/pkg/config/config.go | 1 - 1 file changed, 1 deletion(-) diff --git a/operators/multiclusterobservability/pkg/config/config.go b/operators/multiclusterobservability/pkg/config/config.go index e15950600..c518497ce 100644 --- a/operators/multiclusterobservability/pkg/config/config.go +++ b/operators/multiclusterobservability/pkg/config/config.go @@ -251,7 +251,6 @@ var ( tenantUID = "" imageManifests = map[string]string{} imageManifestConfigMapName = "" - hasCustomRuleConfigMap = false certDuration = time.Hour * 24 * 365 isAlertingDisabled = false From cd428bc5d3d5e4a8ac43359338085cd9cdffa7ba Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Wed, 6 Nov 2024 09:48:37 +0100 Subject: [PATCH 14/17] logs Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- .../controllers/multiclusterobservability/observatorium.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go index ae7192af2..14a8aff7b 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go @@ -177,6 +177,9 @@ func GenerateObservatoriumCR( if equality.Semantic.DeepDerivative(newSpec, oldSpec) && labels[obsCRConfigHashLabelName] == observatoriumCRFound.Labels[obsCRConfigHashLabelName] { + log.Info("Coleen no change in observatorium CR spec") + log.Info("Coleen labels", "labels", labels) + log.Info("Coleen observatoriumCRFound.Labels", "observatoriumCRFound.Labels", observatoriumCRFound.Labels) return nil, nil } From 8fe4d4bceb7286369cafc1588eebefc3a2435e4a Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Wed, 6 Nov 2024 10:00:33 +0100 Subject: [PATCH 15/17] use deep equal Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- .../controllers/multiclusterobservability/observatorium.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go index 14a8aff7b..ab14eefe7 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go @@ -175,7 +175,7 @@ func GenerateObservatoriumCR( } } - if equality.Semantic.DeepDerivative(newSpec, oldSpec) && + if equality.Semantic.DeepEqual(newSpec, oldSpec) && labels[obsCRConfigHashLabelName] == observatoriumCRFound.Labels[obsCRConfigHashLabelName] { log.Info("Coleen no change in observatorium CR spec") log.Info("Coleen labels", "labels", labels) From 0d4871eb130b8db0889dd2d7e9b76921beac55a8 Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Tue, 5 Nov 2024 16:58:08 +0100 Subject: [PATCH 16/17] remove ginkgo focus Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- .../controllers/multiclusterobservability/observatorium.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go index ab14eefe7..6df50e2f3 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go @@ -164,9 +164,6 @@ func GenerateObservatoriumCR( oldSpec := observatoriumCRFound.Spec newSpec := observatoriumCR.Spec - log.Info("Coleen oldSpec", "oldSpec", oldSpec.Thanos.Rule.RulesConfig) - log.Info("Coleen newSpec", "newSpec", newSpec.Thanos.Rule.RulesConfig) - // 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 { From 97573d34457c8a64edb6b3a0949b31b7cca70e6a Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros <coleen.quadros27@gmail.com> Date: Wed, 6 Nov 2024 11:05:04 +0100 Subject: [PATCH 17/17] remove logs Signed-off-by: Coleen Iona Quadros <coleen.quadros27@gmail.com> --- .../controllers/multiclusterobservability/observatorium.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go index 6df50e2f3..73b6d57e5 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium.go @@ -174,9 +174,6 @@ func GenerateObservatoriumCR( if equality.Semantic.DeepEqual(newSpec, oldSpec) && labels[obsCRConfigHashLabelName] == observatoriumCRFound.Labels[obsCRConfigHashLabelName] { - log.Info("Coleen no change in observatorium CR spec") - log.Info("Coleen labels", "labels", labels) - log.Info("Coleen observatoriumCRFound.Labels", "observatoriumCRFound.Labels", observatoriumCRFound.Labels) return nil, nil }