-
Notifications
You must be signed in to change notification settings - Fork 510
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
netdog: Support versioning in net.toml
#2281
netdog: Support versioning in net.toml
#2281
Conversation
#[derive(Debug, Eq, PartialEq, Hash, Deserialize)] | ||
#[serde(try_from = "&str")] | ||
#[derive(Clone, Debug, Eq, PartialEq, Hash, Deserialize)] | ||
#[serde(try_from = "String")] |
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.
Since we now deserialize the majority of the network config to a toml::Value
first (to handle the versions), this is stored as a String
inside of the toml::Value
, hence the change from &str
to String
.
} | ||
} | ||
|
||
// =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= =^..^= |
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.
Nothing has really changed about the below code. This code was moved here into v1.rs
since we use the NetConfigV1
struct for the simple configuration we get from the kernel command line.
This change adds the ability to handle additional versions of `net.toml` as the project continues to add features to network configuration. A top level `NetConfig` type has been removed in favor of a few traits. Each new version of config is expected to implement these traits, the most important of which converts the network configuration into `WickedInterface` structs which are suitable for serializing directly to file. As part of this change, the `net_config` module has been lightly refactored and split into submodules to make the pieces easier to use among new versions.
95efd35
to
1a32d2c
Compare
The above force push:
|
Issue number:
Implements #2214
Description of changes:
Testing done:
aws-k8s-1.21 variant
and ensure the network config is correctmetal-dev
variant and ensure the network config is correct via a givennet.toml
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.