Skip to content

feat(common/networkpolicy): add support for konnectivity-agent deployment#1901

Merged
cwrau merged 1 commit intomainfrom
feat/common/add-support-for-konnectivity-deployment
Jan 15, 2026
Merged

feat(common/networkpolicy): add support for konnectivity-agent deployment#1901
cwrau merged 1 commit intomainfrom
feat/common/add-support-for-konnectivity-deployment

Conversation

@cwrau
Copy link
Member

@cwrau cwrau commented Jan 14, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved network policy configuration to properly support both DaemonSet and Deployment deployment methods for konnectivity-agent.

✏️ Tip: You can customize this high-level summary in your review settings.

@cwrau cwrau requested a review from marvinWolff as a code owner January 14, 2026 14:25
Copilot AI review requested due to automatic review settings January 14, 2026 14:25
@cwrau cwrau enabled auto-merge January 14, 2026 14:25
@gemini-code-assist
Copy link

Summary of Changes

Hello @cwrau, 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 extends the network policy generation logic within the common Helm chart to support konnectivity-agent deployments. Previously, the system only recognized DaemonSet resources for konnectivity-agent. With this update, the network policies will now correctly apply to konnectivity-agent instances deployed as Deployment resources, enhancing compatibility and robustness in various Kubernetes setups.

Highlights

  • Enhanced Konnectivity-Agent Detection: The network policy template now correctly identifies the konnectivity-agent whether it is deployed as a DaemonSet or a Deployment resource within the kube-system namespace.
  • Improved Network Policy Application: This change ensures that network policies are consistently applied to the konnectivity-agent regardless of its underlying Kubernetes workload type, providing greater flexibility.
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.

@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

A network policy template condition was modified to recognize both DaemonSet and Deployment resources named konnectivity-agent in the kube-system namespace, expanding the identity check from DaemonSet-only to include Deployments.

Changes

Cohort / File(s) Summary
Network Policy Template
charts/common/templates/_networkpolicy.tpl
Broadened identity condition to accept either DaemonSet OR Deployment resources with the same name, changing from a single-resource-type check to a multi-type check

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • tasches
  • marvinWolff
  • teutonet-bot

Poem

🐰 A rabbit hops through the network with glee,
Where DaemonSets and Deployments now both can be,
No longer just one kind shall pass the gate,
The identity check now accepts both—how great! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding support for konnectivity-agent Deployment in the network policy template, moving beyond DaemonSet-only support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.



📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3fced54 and 97b854f.

📒 Files selected for processing (1)
  • charts/common/templates/_networkpolicy.tpl
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: wait-for-checks
🔇 Additional comments (1)
charts/common/templates/_networkpolicy.tpl (1)

5-5: LGTM!

The expanded condition correctly handles both DaemonSet and Deployment resource types for konnectivity-agent. The or with dual lookup calls is valid Helm/Sprig syntax and appropriately broadens support for different konnectivity-agent deployment strategies.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the network policy template to support konnectivity-agent running as either a DaemonSet or a Deployment. Previously, only DaemonSet was checked, which could cause incorrect fallback behavior if konnectivity-agent was deployed as a Deployment.

Changes:

  • Modified the conditional check to look for konnectivity-agent in both DaemonSet and Deployment resource types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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 adds support for detecting the konnectivity-agent when it's deployed as a Deployment, in addition to the existing check for a DaemonSet. The logic is correct, but the change makes the conditional line in the Helm template quite long. I've provided a suggestion to format it for better readability and maintainability.

@cwrau cwrau added this pull request to the merge queue Jan 15, 2026
Merged via the queue into main with commit 85ae79f Jan 15, 2026
39 checks passed
@cwrau cwrau deleted the feat/common/add-support-for-konnectivity-deployment branch January 15, 2026 07:08
github-merge-queue bot pushed a commit that referenced this pull request Jan 23, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.8.0](common-v1.7.0...common-v1.8.0)
(2026-01-23)


### Features

* **common/networkpolicy:** add support for konnectivity-agent
deployment
([#1901](#1901))
([85ae79f](85ae79f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants