Skip to content

Conversation

@qinqon
Copy link
Member

@qinqon qinqon commented Dec 11, 2025

Is this a BUG FIX or a FEATURE ?:

Uncomment only one, leave it on its own line:

/kind bug
/kind enhancement

What this PR does / why we need it:

Special notes for your reviewer:

Release note:


@kubevirt-bot
Copy link
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubevirt-bot kubevirt-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 11, 2025
@kubevirt-bot
Copy link
Collaborator

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.

Details

Instructions 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.

@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Dec 11, 2025
@kubevirt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign qinqon for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Netplan Backend PoC: Introduces a Proof of Concept (PoC) for using Netplan as an alternative network configuration backend to the existing nmstate backend within kubernetes-nmstate. This allows for greater flexibility in network management.
  • Backend Abstraction Layer: A new backend interface (pkg/backend) has been implemented, abstracting network configuration operations (Show, Set, Commit, Rollback). This makes the system pluggable and extensible for future backends.
  • D-Bus Integration for Netplan: A dedicated D-Bus client (pkg/netplanctl) has been developed to communicate with the Netplan daemon, mirroring the D-Bus communication pattern used by the nmstate backend with NetworkManager for consistent and reliable integration.
  • API and Deployment Updates: The NMState Custom Resource (CR) now includes a backend field for runtime selection. The build system (Makefile, cluster scripts) and handler DaemonSet (deploy/handler/operator.yaml) have been updated to support building, deploying, and configuring the selected backend.
  • Comprehensive Documentation: Extensive documentation has been added, including detailed guides on backend selection, testing the Netplan PoC, and a status report outlining implementation details, limitations, and future work.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
${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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line contains a debug log message with a "DELETEME" prefix. Such messages should be removed from the code before merging to keep the codebase clean.

@qinqon qinqon marked this pull request as ready for review December 16, 2025 09:07
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 16, 2025
@kubevirt-bot kubevirt-bot requested review from emy and phoracek December 16, 2025 09:08
Signed-off-by: Enrique Llorente <ellorent@redhat.com>
@kubevirt-bot
Copy link
Collaborator

@qinqon: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-nmstate-e2e-operator-k8s 65bdb1c link true /test pull-kubernetes-nmstate-e2e-operator-k8s
pull-kubernetes-nmstate-unit-test 65bdb1c link true /test pull-kubernetes-nmstate-unit-test
pull-kubernetes-nmstate-e2e-handler-k8s 65bdb1c link true /test pull-kubernetes-nmstate-e2e-handler-k8s
pull-kubernetes-nmstate-e2e-upgrade-k8s 65bdb1c link false /test pull-kubernetes-nmstate-e2e-upgrade-k8s
Details

Instructions 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants