Skip to content

Commit

Permalink
Merge pull request #831 from jddcarreira/fixMultipleAppMeshBackends
Browse files Browse the repository at this point in the history
Fix AWS AppMesh issue when providing multiple backends
  • Loading branch information
stefanprodan authored Feb 26, 2021
2 parents 138c42e + 03be6a5 commit dfdd8cf
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions pkg/router/appmesh_v1beta2.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,24 +119,22 @@ func (ar *AppMeshv1beta2Router) reconcileVirtualNode(canary *flaggerv1.Canary, n
}

backends := make([]appmeshv1.Backend, 0)
for _, b := range canary.Spec.Service.Backends {
var bk appmeshv1.Backend
if strings.HasPrefix(b, "arn:aws") {
bk = appmeshv1.Backend{
for i := range canary.Spec.Service.Backends {
if strings.HasPrefix(canary.Spec.Service.Backends[i], "arn:aws") {
backends = append(backends, appmeshv1.Backend{
VirtualService: appmeshv1.VirtualServiceBackend{
VirtualServiceARN: &b,
VirtualServiceARN: &canary.Spec.Service.Backends[i],
},
}
})
} else {
bk = appmeshv1.Backend{
backends = append(backends, appmeshv1.Backend{
VirtualService: appmeshv1.VirtualServiceBackend{
VirtualServiceRef: &appmeshv1.VirtualServiceReference{
Name: b,
Name: canary.Spec.Service.Backends[i],
},
},
}
})
}
backends = append(backends, bk)
}

if len(backends) > 0 {
Expand Down

0 comments on commit dfdd8cf

Please sign in to comment.