Mapping secret to envs looks correct

This commit is contained in:
Cyber MacGeddon 2024-10-14 19:19:13 +01:00
parent a880ca23a5
commit b7f5ec0e99

View file

@ -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
),