Skip to content

Commit

Permalink
Avoid mesh gateway duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprodan committed Mar 1, 2019
1 parent 7f29beb commit 197e987
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/controller/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,17 @@ func (c *CanaryRouter) syncVirtualService(cd *flaggerv1.Canary) error {
targetName := cd.Spec.TargetRef.Name
primaryName := fmt.Sprintf("%s-primary", targetName)
hosts := append(cd.Spec.Service.Hosts, targetName)
gateways := append(cd.Spec.Service.Gateways, "mesh")
gateways := cd.Spec.Service.Gateways
var hasMeshGateway bool
for _, g := range gateways {
if g == "mesh" {
hasMeshGateway = true
}
}
if !hasMeshGateway {
gateways = append(gateways, "mesh")
}

route := []istiov1alpha3.DestinationWeight{
{
Destination: istiov1alpha3.Destination{
Expand Down

0 comments on commit 197e987

Please sign in to comment.