Skip to content

Commit

Permalink
Don't update ASG when there are no targetgroups (#141)
Browse files Browse the repository at this point in the history
Fix #139
  • Loading branch information
mikkeloscar authored Mar 8, 2018
1 parent d63bbb1 commit 83b5e37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aws/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ func (a *Adapter) UpdateTargetGroupsAndAutoScalingGroups(stacks []*Stack) {
for i, stack := range stacks {
targetGroupARNs[i] = stack.targetGroupARN
}

// don't do anything if there are no target groups
if len(targetGroupARNs) == 0 {
return
}

for _, asg := range a.autoScalingGroups {
// This call is idempotent and safe to execute every time
if err := updateTargetGroupsForAutoScalingGroup(a.autoscaling, targetGroupARNs, asg.name); err != nil {
Expand Down

0 comments on commit 83b5e37

Please sign in to comment.