Skip to content

Commit

Permalink
fix bug where users are not able to delete environment variables from…
Browse files Browse the repository at this point in the history
… the front-end (#3583)
  • Loading branch information
Feroze Mohideen authored Sep 15, 2023
1 parent e855b9f commit 3e4a2d0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions api/server/handlers/porter_app/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,23 @@ func buildUmbrellaChartValues(
if existingValues != nil {
if existingValues[helmName] != nil {
existingValuesMap := existingValues[helmName].(map[string]interface{})
if removeDeletedValues {
// strip the env variables before coalescing
if existingValuesMap["container"] != nil {
containerMap := existingValuesMap["container"].(map[string]interface{})
if containerMap["env"] != nil {
envMap := containerMap["env"].(map[string]interface{})
if envMap["normal"] != nil {
envMap["normal"] = make(map[string]interface{})
}
if envMap["synced"] != nil {
envMap["synced"] = make([]map[string]interface{}, 0)
}
containerMap["env"] = envMap
}
existingValuesMap["container"] = containerMap
}
}
helm_values = utils.DeepCoalesceValues(existingValuesMap, helm_values)
}
}
Expand Down

0 comments on commit 3e4a2d0

Please sign in to comment.