From c2f7bf3fb70b927203c1932d071102e2608560d1 Mon Sep 17 00:00:00 2001 From: Gabriel Saratura Date: Tue, 18 Oct 2022 09:42:17 +0200 Subject: [PATCH] Fix multi-instance configuration --- component/class/defaults.yml | 2 +- component/component/app.jsonnet | 6 +++--- ...trics-collector.yaml => collector-cloudscale-lpg-2.yaml} | 0 .../collector-cloudscale-lpg-2/cronjob.yaml | 2 +- .../exoscale-metrics-collector/cronjob.yaml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename component/tests/golden/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/apps/{exoscale-metrics-collector.yaml => collector-cloudscale-lpg-2.yaml} (100%) diff --git a/component/class/defaults.yml b/component/class/defaults.yml index 194b142..68b9177 100644 --- a/component/class/defaults.yml +++ b/component/class/defaults.yml @@ -13,7 +13,7 @@ parameters: collector: registry: 'ghcr.io' repository: 'vshn/exoscale-metrics-collector' - tag: 'v0.2.2' + tag: 'v0.2.3' # Times in UTC! Don't run job around midnight as exoscale API may return incomplete data # default: Every day at minute 10 past hour 10, 16 and 20. schedule: '10 10,16,20 * * *' diff --git a/component/component/app.jsonnet b/component/component/app.jsonnet index 8299569..4420ae1 100644 --- a/component/component/app.jsonnet +++ b/component/component/app.jsonnet @@ -1,11 +1,11 @@ local kap = import 'lib/kapitan.libjsonnet'; local inv = kap.inventory(); -local params = inv.parameters.exoscale_metrics_collector; local paramsACR = inv.parameters.appuio_cloud_reporting; local argocd = import 'lib/argocd.libjsonnet'; -local app = argocd.App('exoscale-metrics-collector', paramsACR.namespace); +local instance = inv.parameters._instance; +local app = argocd.App(instance, paramsACR.namespace); { - 'exoscale-metrics-collector': app, + [instance]: app, } diff --git a/component/tests/golden/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/apps/exoscale-metrics-collector.yaml b/component/tests/golden/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/apps/collector-cloudscale-lpg-2.yaml similarity index 100% rename from component/tests/golden/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/apps/exoscale-metrics-collector.yaml rename to component/tests/golden/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/apps/collector-cloudscale-lpg-2.yaml diff --git a/component/tests/golden/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/cronjob.yaml b/component/tests/golden/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/cronjob.yaml index 9fd3907..9a016ea 100644 --- a/component/tests/golden/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/cronjob.yaml +++ b/component/tests/golden/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/collector-cloudscale-lpg-2/cronjob.yaml @@ -34,7 +34,7 @@ spec: envFrom: - secretRef: name: credentials-collector-cloudscale-lpg-2 - image: ghcr.io/vshn/exoscale-metrics-collector:v0.2.2 + image: ghcr.io/vshn/exoscale-metrics-collector:v0.2.3 name: exoscale-metrics-collector-backfill resources: {} restartPolicy: OnFailure diff --git a/component/tests/golden/exoscale-metrics-collector/exoscale-metrics-collector/exoscale-metrics-collector/cronjob.yaml b/component/tests/golden/exoscale-metrics-collector/exoscale-metrics-collector/exoscale-metrics-collector/cronjob.yaml index 5ededd5..32412fe 100644 --- a/component/tests/golden/exoscale-metrics-collector/exoscale-metrics-collector/exoscale-metrics-collector/cronjob.yaml +++ b/component/tests/golden/exoscale-metrics-collector/exoscale-metrics-collector/exoscale-metrics-collector/cronjob.yaml @@ -34,7 +34,7 @@ spec: envFrom: - secretRef: name: credentials-exoscale-metrics-collector - image: ghcr.io/vshn/exoscale-metrics-collector:v0.2.2 + image: ghcr.io/vshn/exoscale-metrics-collector:v0.2.3 name: exoscale-metrics-collector-backfill resources: {} restartPolicy: OnFailure