Skip to content

Commit

Permalink
Merge pull request #3635 from Shopify/alternative-backend-merge
Browse files Browse the repository at this point in the history
Fix duplicate alternative backend merging
  • Loading branch information
k8s-ci-robot authored Jan 8, 2019
2 parents c31939a + 7142791 commit 47addbb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/ingress/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,13 @@ func mergeAlternativeBackend(priUps *ingress.Backend, altUps *ingress.Backend) b
return false
}

for _, ab := range priUps.AlternativeBackends {
if ab == altUps.Name {
klog.V(2).Infof("skip merge alternative backend %v into %v, it's already present", altUps.Name, priUps.Name)
return true
}
}

priUps.AlternativeBackends =
append(priUps.AlternativeBackends, altUps.Name)

Expand Down

0 comments on commit 47addbb

Please sign in to comment.