From 0b81b2dd9b7c2e064885581fc01f6bd5f5803966 Mon Sep 17 00:00:00 2001 From: Jayapriya Pai Date: Wed, 16 Aug 2023 22:36:25 +0530 Subject: [PATCH] fix: avoid hardcoded versions for Thanos components Signed-off-by: Jayapriya Pai --- go.mod | 1 + pkg/controllers/monitoring/monitoring-stack/components.go | 4 ++-- pkg/controllers/monitoring/thanos-querier/components.go | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2264dd6a..458bdcae 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/prometheus/common v0.44.0 github.com/prometheus/prometheus v1.8.2-0.20211105201321-411021ada9ab github.com/rhobs/obo-prometheus-operator/pkg/apis/monitoring v0.66.0-rhobs1 + github.com/rhobs/obo-prometheus-operator v0.66.0-rhobs1 go.uber.org/zap v1.25.0 golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b gotest.tools/v3 v3.5.0 diff --git a/pkg/controllers/monitoring/monitoring-stack/components.go b/pkg/controllers/monitoring/monitoring-stack/components.go index 3a21e153..10d704ca 100644 --- a/pkg/controllers/monitoring/monitoring-stack/components.go +++ b/pkg/controllers/monitoring/monitoring-stack/components.go @@ -14,6 +14,7 @@ import ( policyv1 "k8s.io/api/policy/v1" rbacv1 "k8s.io/api/rbac/v1" + po "github.com/rhobs/obo-prometheus-operator/pkg/operator" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -181,8 +182,7 @@ func newPrometheus( RuleSelector: prometheusSelector, RuleNamespaceSelector: ms.Spec.NamespaceSelector, Thanos: &monv1.ThanosSpec{ - BaseImage: stringPtr("quay.io/thanos/thanos"), - Version: stringPtr("v0.24.0"), + Image: stringPtr(po.DefaultThanosImage), }, }, } diff --git a/pkg/controllers/monitoring/thanos-querier/components.go b/pkg/controllers/monitoring/thanos-querier/components.go index e7c54357..6a9981e5 100644 --- a/pkg/controllers/monitoring/thanos-querier/components.go +++ b/pkg/controllers/monitoring/thanos-querier/components.go @@ -11,6 +11,7 @@ import ( appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + po "github.com/rhobs/obo-prometheus-operator/pkg/operator" ) func thanosComponentReconcilers(thanos *msoapi.ThanosQuerier, sidecarUrls []string) []reconciler.Reconciler { @@ -68,7 +69,7 @@ func newThanosQuerierDeployment(name string, spec *msoapi.ThanosQuerier, sidecar { Name: "thanos-querier", Args: args, - Image: "quay.io/thanos/thanos:v0.24.0", + Image: po.DefaultThanosImage, Ports: []corev1.ContainerPort{ { ContainerPort: 9090,