From 1997256d50fdd5b17ab0dc801f08542916c67099 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de>
Date: Tue, 20 Jul 2021 17:49:50 +0200
Subject: [PATCH] Create ConfigMaps for benchmark resources

---
 helm/benchmark-definitions                         |  1 +
 .../theodolite/benchmark-resources-config-map.yaml | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
 create mode 120000 helm/benchmark-definitions
 create mode 100644 helm/templates/theodolite/benchmark-resources-config-map.yaml

diff --git a/helm/benchmark-definitions b/helm/benchmark-definitions
new file mode 120000
index 000000000..e25d86a1f
--- /dev/null
+++ b/helm/benchmark-definitions
@@ -0,0 +1 @@
+../theodolite-benchmarks/definitions/
\ No newline at end of file
diff --git a/helm/templates/theodolite/benchmark-resources-config-map.yaml b/helm/templates/theodolite/benchmark-resources-config-map.yaml
new file mode 100644
index 000000000..2f0f210ca
--- /dev/null
+++ b/helm/templates/theodolite/benchmark-resources-config-map.yaml
@@ -0,0 +1,14 @@
+{{- $processedDict := dict -}}
+{{- range $path, $bytes := .Files.Glob "benchmark-definitions/**/resources/**" }}
+{{- $name := base (dir (dir $path)) }}
+{{- if not (hasKey $processedDict $name) -}}
+{{ $_ := set $processedDict $name "true" }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+    name: benchmark-resources-{{ $name }}
+data:
+{{ ($.Files.Glob (printf "benchmark-definitions/%s/resources/*" $name)).AsConfig | indent 2 }}
+---
+{{- end }}
+{{- end }}
\ No newline at end of file
-- 
GitLab