From fe81e7de5640dd202c2139945064fc9b65d23d8e Mon Sep 17 00:00:00 2001
From: paulfantom <pawel@krupa.net.pl>
Date: Tue, 19 Jan 2021 15:45:18 +0100
Subject: [PATCH] jsonnet: fix thanos example

---
 .../addons/thanos-sidecar.libsonnet           | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/jsonnet/kube-prometheus/addons/thanos-sidecar.libsonnet b/jsonnet/kube-prometheus/addons/thanos-sidecar.libsonnet
index 9a195e9d..af6474d2 100644
--- a/jsonnet/kube-prometheus/addons/thanos-sidecar.libsonnet
+++ b/jsonnet/kube-prometheus/addons/thanos-sidecar.libsonnet
@@ -1,9 +1,9 @@
 (import 'github.com/thanos-io/thanos/mixin/alerts/sidecar.libsonnet') +
 {
   values+:: {
-    versions+:: { thanos: 'v0.14.0' },
-    imageRepos+:: { thanos: 'quay.io/thanos/thanos' },
     thanos+:: {
+      version: '0.14.0',
+      image: 'quay.io/thanos/thanos:v0.14.0',
       objectStorageConfig: {
         key: 'thanos.yaml',  // How the file inside the secret is called
         name: 'thanos-objectstorage',  // This is the name of your Kubernetes secret with the config
@@ -26,9 +26,9 @@
       apiVersion: 'v1',
       kind: 'Service',
       metadata: {
-        name: 'prometheus-' + p.name + '-thanos-sidecar',
-        namespace: p.namespace,
-        labels: { prometheus: p.name, app: 'thanos-sidecar' },
+        name: 'prometheus-' + p.config.name + '-thanos-sidecar',
+        namespace: p.config.namespace,
+        labels: { prometheus: p.config.name, app: 'thanos-sidecar' },
       },
       spec: {
         ports: [
@@ -42,9 +42,9 @@
     prometheus+: {
       spec+: {
         thanos+: {
-          version: $._config.versions.thanos,
-          image: $._config.imageRepos.thanos + ':' + $._config.versions.thanos,
-          objectStorageConfig: $._config.thanos.objectStorageConfig,
+          version: $.values.thanos.version,
+          image: $.values.thanos.image,
+          objectStorageConfig: $.values.thanos.objectStorageConfig,
         },
       },
     },
@@ -54,7 +54,7 @@
         kind: 'ServiceMonitor',
         metadata: {
           name: 'thanos-sidecar',
-          namespace: p.namespace,
+          namespace: p.config.namespace,
           labels: {
             'app.kubernetes.io/name': 'prometheus',
           },
@@ -64,7 +64,7 @@
           jobLabel: 'app',
           selector: {
             matchLabels: {
-              prometheus: p.name,
+              prometheus: p.config.name,
               app: 'thanos-sidecar',
             },
           },
-- 
GitLab