From 0487ead0229352547e1fcb2eecf161960f1d1478 Mon Sep 17 00:00:00 2001 From: Coleen Iona Quadros Date: Thu, 24 Oct 2024 20:28:08 +0200 Subject: [PATCH] add test Signed-off-by: Coleen Iona Quadros --- .../observatorium_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium_test.go b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium_test.go index a38d06d71..2f96d17c7 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium_test.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/observatorium_test.go @@ -324,6 +324,22 @@ func TestUpdateObservatoriumCR(t *testing.T) { t.Errorf("%v should be equal to %v", string(createdSpecBytes), string(updatedSpecBytes)) } + // 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") + } + } func TestTShirtSizeUpdateObservatoriumCR(t *testing.T) {