From 21fbc8a644fca6599effba4920ab72385ff1e970 Mon Sep 17 00:00:00 2001 From: Katy Howard Date: Wed, 18 Oct 2023 11:41:12 -0700 Subject: [PATCH] Remove bitnami from prometheus-mongodb-exporter (#1664) * Create mongodb-exporter bitnami repo Signed-off-by: Kathleen Juell * Update main.tf Signed-off-by: Kathleen Juell * Remove prometheus-mongodb-exporter-bitnami Signed-off-by: Kathleen Juell --------- Signed-off-by: Kathleen Juell --- .../config/latest.apko.yaml | 4 -- .../config/main.tf | 5 +- images/prometheus-mongodb-exporter/main.tf | 1 - .../prometheus-mongodb-exporter/tests/main.tf | 50 +++---------------- 4 files changed, 8 insertions(+), 52 deletions(-) diff --git a/images/prometheus-mongodb-exporter/config/latest.apko.yaml b/images/prometheus-mongodb-exporter/config/latest.apko.yaml index ab4911372e..c8ddb09031 100644 --- a/images/prometheus-mongodb-exporter/config/latest.apko.yaml +++ b/images/prometheus-mongodb-exporter/config/latest.apko.yaml @@ -1,9 +1,5 @@ contents: packages: - # These are only needed for bitnami compatiblity. - - bash - - busybox - - prometheus-mongodb-exporter-bitnami-compat accounts: groups: diff --git a/images/prometheus-mongodb-exporter/config/main.tf b/images/prometheus-mongodb-exporter/config/main.tf index 66edb248f3..e456046690 100644 --- a/images/prometheus-mongodb-exporter/config/main.tf +++ b/images/prometheus-mongodb-exporter/config/main.tf @@ -11,10 +11,7 @@ variable "extra_packages" { data "apko_config" "this" { config_contents = file("${path.module}/latest.apko.yaml") - extra_packages = concat( - var.extra_packages, - ["prometheus-mongodb-exporter-bitnami-compat"], - ) + extra_packages = var.extra_packages } output "config" { diff --git a/images/prometheus-mongodb-exporter/main.tf b/images/prometheus-mongodb-exporter/main.tf index b4ba73b7ad..c865c277f4 100644 --- a/images/prometheus-mongodb-exporter/main.tf +++ b/images/prometheus-mongodb-exporter/main.tf @@ -16,7 +16,6 @@ module "latest" { target_repository = var.target_repository config = module.latest-config.config build-dev = true - } module "test-latest" { diff --git a/images/prometheus-mongodb-exporter/tests/main.tf b/images/prometheus-mongodb-exporter/tests/main.tf index ff03d514a7..fd6a011c04 100644 --- a/images/prometheus-mongodb-exporter/tests/main.tf +++ b/images/prometheus-mongodb-exporter/tests/main.tf @@ -14,56 +14,20 @@ data "oci_string" "ref" { resource "random_pet" "suffix" {} -resource "helm_release" "bitnami" { +resource "helm_release" "test" { name = "prometheus-mongodb-exporter-${random_pet.suffix.id}" - repository = "oci://registry-1.docker.io/bitnamicharts" - chart = "mongodb" - - namespace = "prometheus-mongodb-exporter-${random_pet.suffix.id}" - create_namespace = true + repository = "https://prometheus-community.github.io/helm-charts" + chart = "prometheus-mongodb-exporter" values = [jsonencode({ image = { - debug = true - } - metrics = { - enabled = true - image = { - registry = data.oci_string.ref.registry - repository = data.oci_string.ref.repo - digest = data.oci_string.ref.digest - } + repository = data.oci_string.ref.registry_repo + tag = data.oci_string.ref.pseudo_tag } })] - - wait = false -} - -// The upstream helm chart does not become ready even using the upstream image. -// In any case, we only care about the metrics container, which should become ready with our image. -// So instead of waiting for the Helm chart to become ready, we only check the metrics container status. -// This won't be ready immediately, but it should be ready within 30 seconds, or else something is wrong. -data "oci_exec_test" "check-metrics-container" { - depends_on = [helm_release.bitnami] - digest = var.digest - script = <