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

Commit

Permalink
improve var names
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 committed Oct 11, 2024
1 parent 732701b commit c896ac3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 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 {
for envVarName, envVarVal := range envVarOverrides {
translatedOverrides[k] = corev1.EnvVar{
Name: k,
Value: v,
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 c896ac3

Please sign in to comment.