Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
improve env var names
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 committed Oct 14, 2024
1 parent 732701b commit a6e4918
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions kontrol-service/engine/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
Expand Down

0 comments on commit a6e4918

Please sign in to comment.