YAML consolidation prelude: OVS handling (FR-702)#249
Merged
schopin-pro merged 3 commits intocanonical:mainfrom Jan 10, 2022
Merged
YAML consolidation prelude: OVS handling (FR-702)#249schopin-pro merged 3 commits intocanonical:mainfrom
schopin-pro merged 3 commits intocanonical:mainfrom
Conversation
5 tasks
slyon
approved these changes
Jan 6, 2022
Contributor
slyon
left a comment
There was a problem hiding this comment.
LGTM! It makes sense to handle the definitions in an ordered way. If you don't mind I'd like the ovs-ports name, though, as this is kind of an edge case and should be visible as such, IMO.
Thanks!
Codecov Report
@@ Coverage Diff @@
## main #249 +/- ##
=======================================
Coverage 99.10% 99.10%
=======================================
Files 58 58
Lines 10052 10052
=======================================
Hits 9962 9962
Misses 90 90
Continue to review full report at Codecov.
|
a3ca281 to
901c928
Compare
The previous implementation relied on the order of traversal of a hashtable, which isn't exactly reliable. It wasn't problematic because the semantics of the port pair are symetrical, but since we're planing on using the YAML netplan generator backend as a passthrough for `netplan set`, we want to preserve the user's input as pristinely as possible. The new implementation uses the ordered list of netdefs to determine the order in which netdefs are processed, which is both deterministic and sensible, since it respects the order in which the user fed us the info (modulo the grouping by devtype).
Later in the patchset we expose this data to Python, and are using the names rather than the integers to represent the netdef types. As a result, we need a proper name for this type to distinguish it from the default value.
Contrary to all other def types, this one is "virtual", as it doesn't have a YAML key matching it. Prefixing it with an underscore should make it obvious that *something* is different there. Co-authored-by: Lukas Märdan <[email protected]> Co-authored-by: Lukas Märdian <[email protected]>
901c928 to
2625234
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A couple of patches related to OpenVSwitch handling. The consistency patch is needed to be able to ensure idempotency of the user input (within reason). The type name definition will be needed when we'll rewrite
sriov.pyas we'll need to identify those definitions.Checklist
make checksuccessfully.make check-coverage).