-
Notifications
You must be signed in to change notification settings - Fork 918
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
Oracle netplan v2 migration #6024
base: main
Are you sure you want to change the base?
Oracle netplan v2 migration #6024
Conversation
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.
See my inline comments. I think you added some good code, but much of it can move into tests.
Additionally, I forget, why are we moving to support both v1 and v2 now? Once we move to v2, is there any reason we would need to keep the v1 support around?
@TheRealFalcon thanks for the feedback! I guess the idea here was that by keeping the old v1 code around, we could do the comparisons on live systems that way if anyone ever finds a weird edge case then it will log a warning and they could file a bug. But honestly, now that you mention it, I do kinda prefer the idea of just having a super comprehensive unit test suite to verify it once and be done and then move on with our lives. @holmanb thoughts? since this was your idea originally? |
The only benefit that I see of a runtime check is that it might catch edge cases that couldn't be predicted with a battery of unit tests. I'm fine with just getting some good test coverage instead if that's preferred. |
f5074ad
to
6711993
Compare
6711993
to
8302d70
Compare
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.
@a-dubs I left some comments below.
8bbaa92
to
bf79f07
Compare
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.
PR Overview
This PR migrates the Oracle datasource configuration from netplan v1 to netplan v2 and improves test coverage for helper functions.
- Updates the Oracle datasource to use the new netplan v2 configuration schema.
- Adds a set of comprehensive unit tests for the dict comparison helper function.
- Introduces YAML import and logger initialization in the test helpers to support improved debugging.
Reviewed Changes
File | Description |
---|---|
tests/unittests/helpers.py | Adds YAML import, logger initialization, and the dicts_are_equal helper function. |
tests/unittests/test_helpers.py | Introduces unit tests for the dicts_are_equal function. |
cloudinit/sources/DataSourceOracle.py | Migrates Oracle datasource configuration from netplan v1 to v2 and refactors related methods. |
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
if not metadata_address: | ||
return False | ||
return metadata_address.startswith(IPV4_METADATA_ROOT.split("opc")[0]) | ||
def convert_v1_netplan_to_v2(network_config: dict) -> dict: |
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.
The function convert_v1_netplan_to_v2 uses the protected method _render_content from netplan.Renderer, which may break if the internal API changes. Consider using a public API for rendering if available.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
Proposed Commit Message
Additional Context
Test Steps
Ran the full integration test suite against Noble using a custom deb created from this feature branch.
Merge type