Skip to content

Commit

Permalink
Merge pull request #124 from ninech/no-env-update
Browse files Browse the repository at this point in the history
fix: do not update/sort env vars when nothing changes
  • Loading branch information
ctrox authored Jul 10, 2024
2 parents 5ee8326 + 6815ad4 commit bbcf0c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/util/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func EnvVarsFromMap(env map[string]string) apps.EnvVars {
}

func UpdateEnvVars(oldEnvs []apps.EnvVar, newEnvs map[string]string, toDelete []string) apps.EnvVars {
if len(newEnvs) == 0 && len(toDelete) == 0 {
return oldEnvs
}

envMap := map[string]apps.EnvVar{}
for _, v := range oldEnvs {
envMap[v.Name] = v
Expand Down

0 comments on commit bbcf0c9

Please sign in to comment.