Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AWS AppMesh issue when providing multiple backends #831

Merged
merged 1 commit into from
Feb 26, 2021

Conversation

jddcarreira
Copy link
Contributor

Signed-off-by: Joao Carreira jddcarreira@gmail.com

When adding multiple backend (by arn or by virtual service name), while using AWS App Mesh as a provided, Flagger was returning the following error:

reconcileVirtualNode failed: VirtualNode test-app-primary update error admission webhook "vvirtualnode.appmesh.k8s.aws" denied the request: VirtualNode-test-app-primary has duplicate VirtualServiceReferenceARNs arn:aws:appmesh:eu-west-1:0000000000:mesh/mymesh/virtualService/api-bar.local

This was caused by a wrong usage of range, since in a range when targeting the pointer of an element it seems to return the object of the slice and not the object of the element in the slice.
https://golang.org/doc/effective_go#slices

Here's a representation of what was happening:

In this MR we make use of the index to access the element of the slice, representing each backend.

Signed-off-by: Joao Carreira <jddcarreira@gmail.com>
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @jddcarreira

@stefanprodan stefanprodan merged commit dfdd8cf into fluxcd:main Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants