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

Move instance networking functions into their own module #4123

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

gjcolombo
Copy link
Contributor

nexus/src/app/instance.rs and sled.rs implement several networking-related functions that are less directly concerned with instance or sled management than their sibling routines. Tidy things up a bit by creating an instance_network module and moving instance V2P and NAT management functions there. Also, move instance NAT entry deletion logic into its own function that's called from the instance delete saga instead of implementing it inline in that saga.

These changes aim to reduce clutter in instance.rs and to move NAT entry deletion to a function that can be reused by subsequent changes to the way Nexus handles instance stop.

Except for some minor edits to error handling in instance_delete_dpd_config (needed because this function no longer returns a steno::ActionError), this PR only rearranges existing code and has no functional changes.

@gjcolombo gjcolombo marked this pull request as ready for review September 20, 2023 16:32
Copy link
Collaborator

@smklein smklein left a comment

Choose a reason for hiding this comment

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

I checked that functions signatures look the same (and they do, with the exception of the new function) but not that the bodies are the same. Trusting you that they are!

Thanks for the cleanup.

nexus/src/app/instance.rs Outdated Show resolved Hide resolved
@gjcolombo gjcolombo enabled auto-merge (squash) September 21, 2023 15:14
@gjcolombo gjcolombo merged commit 79fee6a into main Sep 21, 2023
19 of 20 checks passed
@gjcolombo gjcolombo deleted the gjcolombo/instance-networking-module branch September 21, 2023 16:24
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