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

Add type conversions for EarlyNetworkConfig upgrade #4285

Merged
merged 12 commits into from
Oct 18, 2023

Conversation

andrewjstone
Copy link
Contributor

This commit adds deserialization and conversion support for v0 and v1 of EarlyNetworkConfig types. Future commits will add support for writing the v1 version back to the bootstore ledger if necessary. Unit tests for conversion also coming soon.

This commit adds deserialization and conversion support for v0 and v1
of EarlyNetworkConfig types. Future commits will add support for writing
the v1 version back to the bootstore ledger if necessary. Unit tests for
conversion also coming soon.
common/src/api/internal/shared.rs Outdated Show resolved Hide resolved
common/src/api/internal/shared.rs Outdated Show resolved Hide resolved
sled-agent/src/bootstrap/early_networking.rs Outdated Show resolved Hide resolved
@andrewjstone
Copy link
Contributor Author

After discussion with @jgallagher, it seems unnecessary and potentially dangerous to write the updated schema back to the ledger since we can deterministically convert from EarlyNetworkConfigV0 to EarlyNetworkConfigV1. Therefore, after some unit tests and small cleanup this should be good to go on the sled-agent side.

/// Convert from `RackNetworkConfigV0` to `RackNetworkConfigV1`
///
/// We cannot use `From<RackNetworkConfigV0> for `RackNetworkConfigV1`
/// because the `rack_network` field does not exist in `RackNetworkConfigV0`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
/// because the `rack_network` field does not exist in `RackNetworkConfigV0`
/// because the `rack_subnet` field does not exist in `RackNetworkConfigV0`

@andrewjstone andrewjstone merged commit 32be2e4 into bgp Oct 18, 2023
21 of 22 checks passed
@andrewjstone andrewjstone deleted the bgp-bootstore-upgrade branch October 18, 2023 06:21
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.

3 participants