-
Notifications
You must be signed in to change notification settings - Fork 106
PoC: Add netplan as alternative backend to nmstate #1412
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
base: main
Are you sure you want to change the base?
Conversation
|
Skipping CI for Draft Pull Request. |
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of ChangesHello @qinqon, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a Proof of Concept for integrating Netplan as an alternative network configuration backend for kubernetes-nmstate. The core change involves creating a new backend abstraction layer that allows the system to dynamically switch between the default nmstate backend and the new netplan backend. This is achieved through modifications to the NMState CR, a new D-Bus client for Netplan, and updates across the codebase to leverage this pluggable architecture. The goal is to provide more options for network configuration within Kubernetes environments, with a focus on reliable D-Bus-based communication. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a Proof of Concept for adding netplan as an alternative network configuration backend to nmstate. The changes are extensive and well-structured, introducing a backend abstraction layer that allows for different network configuration tools to be used. The new netplan backend is implemented using its D-Bus API, which is a robust approach. The changes span across the API, controllers, build scripts, and documentation, providing a comprehensive foundation for this new feature. My review focuses on improving the robustness of the development scripts and cleaning up leftover debugging code.
| echo 'Ensuring D-Bus and netplan are installed on kind nodes for netplan backend' | ||
| for node in $(./cluster/kubectl.sh get nodes --no-headers | awk '{print $1}'); do | ||
| echo "Installing D-Bus and netplan on ${node}" | ||
| ${CRI_BIN} exec ${node} sh -c "apt-get update -qq && apt-get install -y dbus dbus-x11 netplan.io" > /dev/null 2>&1 || true |
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 use of || true after the apt-get install command suppresses any errors that might occur during package installation on the kind nodes. This could lead to silent failures where dependencies are not installed, making it difficult to debug issues later. It would be more robust to allow the script to fail if a required dependency cannot be installed.
| ${CRI_BIN} exec ${node} sh -c "apt-get update -qq && apt-get install -y dbus dbus-x11 netplan.io" > /dev/null 2>&1 || true | |
| ${CRI_BIN} exec ${node} sh -c "apt-get update -qq && apt-get install -y dbus dbus-x11 netplan.io" > /dev/null 2>&1 |
| // -m: enter mount namespace (needed to access host's systemd) | ||
| // Note: -n (network) is not needed since we already use hostNetwork: true | ||
| output, err := exec.Command("nsenter", "-t", "1", "-m", "netplan", "status", "-f", "json").CombinedOutput() | ||
| klog.Infof("DELETEME: netplan.Status, output: %s", output) |
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.
Signed-off-by: Enrique Llorente <ellorent@redhat.com>
|
@qinqon: The following tests failed, say
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Is this a BUG FIX or a FEATURE ?:
What this PR does / why we need it:
Special notes for your reviewer:
Release note: