Skip to content

Fix chart rendering in dry-run or "helm template" scenarios#5760

Merged
oilbeater merged 1 commit intokubeovn:masterfrom
abhishek-pandey-1:fix-dry-run-rending-of-charts
Nov 6, 2025
Merged

Fix chart rendering in dry-run or "helm template" scenarios#5760
oilbeater merged 1 commit intokubeovn:masterfrom
abhishek-pandey-1:fix-dry-run-rending-of-charts

Conversation

@abhishek-pandey-1
Copy link
Copy Markdown
Contributor

Pull Request

What type of this PR

Examples of user facing changes:

  • Bug fixes

Which issue(s) this PR fixes

Fixes #5752

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Sep 29, 2025
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @abhishek-pandey-1, 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 addresses a critical bug in the Kube-OVN Helm charts that caused rendering failures during dry-run or helm template operations. The issue stemmed from the kubeovn.nodeIPs helper attempting to query Kubernetes nodes even when no cluster connection was available. The fix introduces a conditional check to ensure the chart can be templated without errors by bypassing the node lookup if no nodes are returned, thereby improving the chart's robustness and usability in various deployment scenarios.

Highlights

  • Helm Chart Compatibility: Modified the kubeovn.nodeIPs helper in both Kube-OVN Helm charts to gracefully handle scenarios where no Kubernetes nodes are found, specifically addressing issues during helm template or dry-run operations.
  • Bug Fix: Resolved a bug (Fixes [BUG] helm template or client-side dry-run fails on chart #5752) where the Helm chart would fail to render in environments without an active Kubernetes cluster connection, such as when using helm template, by preventing node lookup when no nodes are present.
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.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @abhishek-pandey-1, 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 resolves an issue preventing Kube-OVN Helm charts from rendering successfully in dry-run or helm template scenarios. The fix involves enhancing the kubeovn.nodeIPs helper function to gracefully handle situations where no Kubernetes nodes are present, ensuring that the templating process completes without errors and allowing for offline chart validation.

Highlights

  • Helm Chart Compatibility: Modified the kubeovn.nodeIPs helper function in both kube-ovn and kube-ovn-v2 Helm charts to correctly handle scenarios where no Kubernetes nodes are available, such as during helm template or dry-run operations.
  • Bug Fix: Addresses a bug where the Helm chart rendering would fail in environments without active Kubernetes nodes, specifically when attempting to retrieve master node IP addresses, by introducing a conditional check.
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.

@dosubot dosubot bot added the bug Something isn't working label Sep 29, 2025
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @abhishek-pandey-1, 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 resolves a critical bug in the Kube-OVN Helm charts that prevented them from being rendered successfully in dry-run or helm template modes. The issue stemmed from the kubeovn.nodeIPs helper function attempting to process an empty list of nodes when no active Kubernetes cluster was present. The fix introduces a conditional check to gracefully bypass this operation when no nodes are found, ensuring the charts can be templated and validated without requiring a live cluster.

Highlights

  • Helm Chart Compatibility: Modified the kubeovn.nodeIPs helper function in both kube-ovn and kube-ovn-v2 Helm charts to correctly handle scenarios where no Kubernetes nodes are available, such as during helm template or dry-run operations.
  • Bug Fix: Addresses a bug where the Helm chart rendering would fail in dry-run environments due to the lookup function returning an empty list of nodes, which was not properly handled previously, leading to rendering errors.
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
Copy Markdown
Contributor

@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 correctly fixes an issue where helm template would fail due to the lookup function not being available during a dry run. The approach of checking the result of lookup before proceeding is sound. I've added a couple of suggestions to improve the readability of the new conditional logic by simplifying the if/else structure into a single if block. Overall, the changes are good and address the problem effectively.

Copy link
Copy Markdown
Contributor

@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 correctly fixes an issue with Helm chart rendering during dry-runs by checking if the lookup function returns any nodes. The changes in _helpers.tpl for both kube-ovn and kube-ovn-v2 charts will prevent failures when a Kubernetes cluster is not available.

I've added a couple of suggestions to make the template logic more concise and idiomatic by simplifying the conditional checks. The proposed changes improve readability but the current implementation is also functionally correct.

Comment thread charts/kube-ovn-v2/templates/_helpers.tpl Outdated
Comment thread charts/kube-ovn/templates/_helpers.tpl Outdated
Copy link
Copy Markdown
Contributor

@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 fixes an issue with Helm chart rendering during dry-runs (helm template) by adding a check to the kubeovn.nodeIPs helper. When no nodes are found via lookup, which is typical in a dry-run, the helper now correctly returns an empty value instead of erroring out. The changes in both charts/kube-ovn-v2 and charts/kube-ovn are correct. I've added a couple of suggestions to improve the readability and follow a more idiomatic approach for the conditional logic in the Helm templates.

@oilbeater
Copy link
Copy Markdown
Collaborator

@abhishek-pandey-1 the DCO check failed, please sign off the commit.

@abhishek-pandey-1
Copy link
Copy Markdown
Contributor Author

abhishek-pandey-1 commented Sep 29, 2025 via email

@6ixfalls
Copy link
Copy Markdown
Contributor

6ixfalls commented Nov 5, 2025

@abhishek-pandey-1 Could you check in on this again?

@abhishek-pandey-1
Copy link
Copy Markdown
Contributor Author

Ah sorry - got too caught up in other things. Will fix this now.

@abhishek-pandey-1 abhishek-pandey-1 force-pushed the fix-dry-run-rending-of-charts branch from 94cb609 to 8dbb40c Compare November 6, 2025 14:15
Signed-off-by: Abhishek Pandey <abhpandey@microsoft.com>
@abhishek-pandey-1 abhishek-pandey-1 force-pushed the fix-dry-run-rending-of-charts branch from 8dbb40c to 3df0192 Compare November 6, 2025 14:16
@abhishek-pandey-1
Copy link
Copy Markdown
Contributor Author

@oilbeater @6ixfalls - fixed the problem. Happy for you to complete this at your own discretion

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 19138630281

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 21.536%

Totals Coverage Status
Change from base Build 19131241215: 0.0%
Covered Lines: 10938
Relevant Lines: 50789

💛 - Coveralls

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 6, 2025
@oilbeater oilbeater merged commit 94f7c47 into kubeovn:master Nov 6, 2025
72 of 73 checks passed
@oilbeater
Copy link
Copy Markdown
Collaborator

@abhishek-pandey-1 Thanks for coming back!

oilbeater pushed a commit that referenced this pull request Nov 7, 2025
Signed-off-by: Abhishek Pandey <abhpandey@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] helm template or client-side dry-run fails on chart

4 participants