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 VirtualRouter route deletion sequence #768

Merged
merged 4 commits into from
Apr 17, 2024

Conversation

dhild
Copy link
Contributor

@dhild dhild commented Mar 21, 2024

This addresses a few rough edges with updating a VirtualRouter, by removing routes which will be deleted before updating the listeners. After this change, it is possible to update the listener protocol on the CRD in one step. It is also possible to remove the listener at the same time as the routes which use that listener.

Issue #, if available: #767

Description of changes:

Adds a step to the VirtualRouter reconciliation sequence which identifies the routes to remove and deletes them before the corresponding listeners are updated. This allows a greater range of valid API changes to be successfully reconciled.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

dhild added 2 commits March 21, 2024 15:54
This addresses a few rough edges with updating a VirtualRouter. After
this change, it is possible to update the listener protocol on the CRD
in one step. It is also possible to remove the listener at the same time
as the routes which use that listener.
When running this against a test cluster, discovered that the logic must
filter to only names with SDK routes before adding them to a deletion
list.
@dhild dhild changed the title Remove routes before the matching listener Fix VirtualRouter route deletion sequence Mar 25, 2024

return unmatchedSDKRouteRefs
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we get unit tests covering remove and this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll get some test coverage written up for those.

dhild added 2 commits April 16, 2024 13:59
Adds unit test coverage for the new functions. A possible nil pointer
dereference is fixed, which could occur if port matching is not
utilized.
The API call to describe the route is not needed, as the route ref
contains all the information needed to delete routes.
@dhild dhild requested a review from BennettJames April 16, 2024 21:51
@BennettJames BennettJames merged commit 0d12952 into aws:master Apr 17, 2024
3 checks passed
@BennettJames
Copy link
Contributor

Merged.

It might be a bit before we release this as the default, but we can try to put up a version you can use in the meantime with a helm override if that'd be useful.

@dhild
Copy link
Contributor Author

dhild commented Apr 17, 2024

Great, thanks! I would appreciate having an official image to run these changes in test environments, if it’s not too much trouble.

@dhild dhild deleted the remove-routes-earlier branch April 17, 2024 02:07
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