From a6e4918eb8124a9c6f90364d0a1d810e8514fe3c Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Mon, 14 Oct 2024 23:36:30 +0900 Subject: [PATCH] improve env var names --- kontrol-service/engine/docker.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kontrol-service/engine/docker.go b/kontrol-service/engine/docker.go index ee6b7a4..7d75b41 100644 --- a/kontrol-service/engine/docker.go +++ b/kontrol-service/engine/docker.go @@ -81,21 +81,21 @@ func applyEnvVarOverrides( envVars []corev1.EnvVar) []corev1.EnvVar { // merge environment variables and env var overrides translatedOverrides := map[string]corev1.EnvVar{} - for k, v := range envVarOverrides { - translatedOverrides[k] = corev1.EnvVar{ - Name: k, - Value: v, + for envVarName, envVarVal := range envVarOverrides { + translatedOverrides[envVarName] = corev1.EnvVar{ + Name: envVarName, + Value: envVarVal, ValueFrom: nil, } } - for k, v := range secretEnvVarOverrides { - translatedOverrides[k] = corev1.EnvVar{ - Name: k, + for envVarName, envVarValue := range secretEnvVarOverrides { + translatedOverrides[envVarName] = corev1.EnvVar{ + Name: envVarName, ValueFrom: &corev1.EnvVarSource{ SecretKeyRef: &corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: v}, // assume v is the secret name - Key: k, + LocalObjectReference: corev1.LocalObjectReference{Name: envVarValue}, // assume v is the secret name + Key: envVarName, Optional: nil, }, },