From 4b5b94347dd71b3649fef612ab3b8cf237ac48b9 Mon Sep 17 00:00:00 2001
From: Joseph Daniel <godwhoa@users.noreply.github.com>
Date: Mon, 21 Aug 2023 14:47:16 +0530
Subject: [PATCH] Fix alertmanager external config example (#1891)

Co-authored-by: Joseph Daniel <joseph@apxor.com>
---
 examples/alertmanager-config-template-external.jsonnet | 7 +++++--
 examples/alertmanager-config-with-template.yaml        | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/examples/alertmanager-config-template-external.jsonnet b/examples/alertmanager-config-template-external.jsonnet
index 73b3ee4f..cac8599c 100644
--- a/examples/alertmanager-config-template-external.jsonnet
+++ b/examples/alertmanager-config-template-external.jsonnet
@@ -15,6 +15,9 @@ local kp =
       common+: {
         namespace: 'monitoring',
       },
+      alertmanager+: {
+        config: importstr 'alertmanager-config.yaml',
+      },
     },
     alertmanager+:: {
       alertmanager+: {
@@ -26,9 +29,9 @@ local kp =
     },
     configmap+:: {
       'alert-templates': configmap(
-        'alertmanager-alert-template.tmpl',
+        'alert-templates',
         $.values.common.namespace,  // could be $._config.namespace to assign namespace once
-        { data: importstr 'alertmanager-alert-template.tmpl' },
+        { 'alertmanager-alert-template.tmpl': importstr 'alertmanager-alert-template.tmpl' },
       ),
     },
   };
diff --git a/examples/alertmanager-config-with-template.yaml b/examples/alertmanager-config-with-template.yaml
index b574b666..383332b5 100644
--- a/examples/alertmanager-config-with-template.yaml
+++ b/examples/alertmanager-config-with-template.yaml
@@ -24,4 +24,4 @@ slack_configs:
     text: '{{ template "slack.text" . }}
 
 templates:
-- '/etc/alertmanager/configmaps/alertmanager-alert-template.tmpl'
+- '/etc/alertmanager/configmaps/alert-templates/*.tmpl'
-- 
GitLab