-
Notifications
You must be signed in to change notification settings - Fork 267
Route updates don't work in when two routes have same value for one of the route fields #2090
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
Comments
In fact, this happens when any kind of update is performed on the CR. So, as long as we have two routes with same value for one of the fields (in this case, |
@nnbu I guess this implementation is not correct https://github.com/aws-controllers-k8s/ec2-controller/blob/main/pkg/resource/route_table/sdk.go#L613 |
Issues go stale after 180d of inactivity. |
I have the same problem, where there are multiple CIDR blocks in a peered VPC. The order as specified in ACK is different from what is returned by the API. As the Here a (slightly obfuscated) trace:
Long story short: it creates two calls to delete the route with the destination CIDR block I'm wondering about this code block. What is the reason for declaring a route matching, just because one property is? |
Fixes issue [#2090](aws-controllers-k8s/community#2090) Description of changes: - Configure generator for RouteTable to ignore the Routes from the generated delta code. - Extend the `customPreCompare` code to take care of the routes (computing the delta ignoring the order of routes). - Added unit test for the custom code. - Change the `syncRoutes` code to use the delta from the compare phase. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Hello @nnbu, we have released the controller with a fix addressing this issue. |
@michaelhtm: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Describe the bug
When we change the routes (e.g. delete some of the routes) from the route table CR, the CR status goes to
out of sync
for the remaining routes.Steps to reproduce
This happens in specific case where route comparison logic does not work. E.g. when we have two routes with say, same
vpcPeeringConnectionID
.destinationCIDRBlock
, but samevpcPeeringConnectionID
.sync
172.29.0.0/16
(without changing two routes with samevpcPeeringConnectionID
). This triggersupdate
and controller tries to find what needs to be deleted/added.out of sync
state with error something likeThis suggests that
update
tried to create route172.30.0.0/16
and failed withRouteAlreadyExists
error.On prima facie, there appears to be two issues
vpcPeeringConnectionID
) having same value for two routes. Due to this same value, it thinks, the route is getting updated from172.28.0.0/16
to172.30.0.0/16
. So, it tries add172.30.0.0/16
and fails with the error.Ideally, this logic should not have determined any update for these two routes with
vpcPeeringConnectionID
.update
determines that there is a route to be deleted and added, it createstoAdd
andtoDelete
lists.Ideally,
delete
should happen first and thenadd
should happen later. But current logic is reverse.Expected outcome
CR should not go into
out of sync
state.Environment
The text was updated successfully, but these errors were encountered: