Skip to content

Commit

Permalink
reset configmap and secret refs before adding latest env groups (#3589)
Browse files Browse the repository at this point in the history
Co-authored-by: David Townley <[email protected]>
  • Loading branch information
d-g-town and David Townley authored Sep 18, 2023
1 parent dbc7bbd commit 366ec2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/server/handlers/porter_app/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ func syncEnvironmentGroupToNamespaceIfLabelsExist(ctx context.Context, agent *ku
}
}

service.Config["configMapRefs"] = []string{}
service.Config["secretRefs"] = []string{}

for _, linkedGroupName := range strings.Split(linkedGroupNames, ".") {
inp := environment_groups.SyncLatestVersionToNamespaceInput{
BaseEnvironmentGroupName: linkedGroupName,
Expand All @@ -385,7 +388,7 @@ func syncEnvironmentGroupToNamespaceIfLabelsExist(ctx context.Context, agent *ku
service.Config["configMapRefs"] = append(service.Config["configMapRefs"].([]any), syncedEnvironment.EnvironmentGroupVersionedName)
}

switch service.Config["configMapRefs"].(type) {
switch service.Config["secretRefs"].(type) {
case []string:
service.Config["secretRefs"] = append(service.Config["secretRefs"].([]string), syncedEnvironment.EnvironmentGroupVersionedName)
case []any:
Expand Down

0 comments on commit 366ec2a

Please sign in to comment.