-
Notifications
You must be signed in to change notification settings - Fork 71
change FindServiceNetwork algo, use name and id match #566
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
Conversation
pkg/aws/services/vpclattice.go
Outdated
| ListServiceNetworkVpcAssociationsAsList(ctx context.Context, input *vpclattice.ListServiceNetworkVpcAssociationsInput) ([]*vpclattice.ServiceNetworkVpcAssociationSummary, error) | ||
| ListServiceNetworkServiceAssociationsAsList(ctx context.Context, input *vpclattice.ListServiceNetworkServiceAssociationsInput) ([]*vpclattice.ServiceNetworkServiceAssociationSummary, error) | ||
| FindServiceNetwork(ctx context.Context, name string, accountId string) (*ServiceNetworkInfo, error) | ||
| FindServiceNetwork(ctx context.Context, name string) (*ServiceNetworkInfo, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to change name to nameOrId string in interface?
| }) | ||
| idMatch := utils.SliceFilter(allSn, func(snSum *vpclattice.ServiceNetworkSummary) bool { | ||
| return aws.StringValue(snSum.Id) == nameOrId | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the discussion in slack, filter by name then id make sense. We could also add another filter by ARN, i.e. change function name to
FindServiceNetwork(ctx context.Context, nameOrIdOrArn string) and add a arnMatch=
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would drop ID and use ARN only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ARN is not a valid name for Gateway, "/" if not allowed
dbbe7e1 to
6597294
Compare
2a89b78 to
e8e4bdc
Compare
e8e4bdc to
f359d36
Compare
f359d36 to
606ba58
Compare
Note:
Address bug for RAM sharing scenario with ServiceNetwork. Currently FindServiceNetwork will not find shared SNs, but if find will fail on fetching Tags. It's not possible to fetch tags for external resources.
Important changes in vpclattice.go
New algorithm will do:
Added unit tests.
Manually tested with shared SN scenarios.
New error log example:
Related #565