parse: Add the filepath to OVS ports netdefs#295
Conversation
slyon
left a comment
There was a problem hiding this comment.
Thank you for spotting this issue and coming up with a fix right away, incl. a unit test!
I was wondering if we could actually move the assignment of component->filepath into netplan_netdef_new() instead, so we wouldn't have to assign it in different places.
But the problem is with one YAML file overriding another... Could you please extend the test case to e.g. have a.yaml defining the patch ports (openvswitch.ports) and having another (higher order) b.yaml file, re-defining the global OVS settings. What would be the value of filepath? I assume it would be a.yaml whereas it should be b.yaml.
Currently, the filepath is only set if the component does not yet exist, while we'd want it to be update if the component is being overriden by an higher order config file.
|
You are right! My patch wasn't updating the filepath in case of redefinition. About setting the filepath in the netplan_netdef_new() function, we could do that. But the filepath update still must be done in the handle_*() functions as we are not creating new netdefs in case of redefinition. |
The filepath isn't being populated for OVS ports netdefs. Add a unit test to catch this issue.
When the object is redefined by a different yaml file, the filepath must be updated to refer to that file. Add a unit test to check for this invariant.
155b7e0 to
a4e6662
Compare
slyon
left a comment
There was a problem hiding this comment.
Thank you! LGTM.
I just rebased it on top of origin/main. Let's wait for the CI to pass, before merging it.
The filepath isn't being populated for OVS ports netdefs.
Add a unit test to catch this issue.
New unit test outcome without the fix:
Checklist
make checksuccessfully.make check-coverage).