Skip to content

Commit

Permalink
fix: rollback
Browse files Browse the repository at this point in the history
Signed-off-by: moko-poi <[email protected]>
  • Loading branch information
moko-poi committed Nov 1, 2023
1 parent 70e1a1c commit 0122ebb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/app/piped/executor/ecs/ecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ func routing(ctx context.Context, in *executor.Input, platformProviderName strin

currListenerRuleArns, err := client.GetListenerRuleArns(ctx, currListenerArns)
if err != nil {
in.LogPersister.Errorf("Failed to get current active listeners: %v", err)
in.LogPersister.Errorf("Failed to get current active listener rule: %v", err)
return false
}

Expand Down
10 changes: 8 additions & 2 deletions pkg/app/piped/executor/ecs/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,14 @@ func rollback(ctx context.Context, in *executor.Input, platformProviderName stri
return false
}

if err := client.ModifyListeners(ctx, currListenerArns, routingTrafficCfg); err != nil {
in.LogPersister.Errorf("Failed to routing traffic to PRIMARY variant: %v", err)
currListenerRuleArns, err := client.GetListenerRuleArns(ctx, currListenerArns)
if err != nil {
in.LogPersister.Errorf("Failed to get current active listener rule: %v", err)
return false
}

if err := client.ModifyListenerOrRule(ctx, currListenerArns, currListenerRuleArns, routingTrafficCfg); err != nil {
in.LogPersister.Errorf("Failed to routing traffic to PRIMARY/CANARY variants: %v", err)
return false
}
}
Expand Down

0 comments on commit 0122ebb

Please sign in to comment.