From b7f5ec0e9994122c264ca2f45e593eb4c3173c45 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Mon, 14 Oct 2024 19:19:13 +0100 Subject: [PATCH] Mapping secret to envs looks correct --- templates/engine/k8s.jsonnet | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/templates/engine/k8s.jsonnet b/templates/engine/k8s.jsonnet index e9530ed0..656b360a 100644 --- a/templates/engine/k8s.jsonnet +++ b/templates/engine/k8s.jsonnet @@ -25,15 +25,6 @@ ], }, - with_environment_valueFrom:: function(x) self + { - environment: super.environment + [ - { - name: v.key, value: v.value - } - for v in std.objectKeysValues(x) - ], - }, - with_limits:: function(c, m) self + { limits: { cpu: c, memory: m } }, with_reservations:: @@ -57,18 +48,17 @@ with_env_var_secrets:: function(vars) std.foldl( - function(obj, x) obj + obj.with_environment_valueFrom( - { - [x]: { - valueFrom: { - secretKeyRef: { - name: vars.name, - key: x, - } + function(obj, x) obj + { + environment: super.environment + [{ + name: x, + valueFrom: { + secretKeyRef: { + name: vars.name, + key: x, } } - } - ), + }] + }, vars.variables, self ),