Skip to content

Comments

fix: include rendered templates in helm manifest generation#878

Open
parthivsaikia wants to merge 3 commits intomeshery:masterfrom
parthivsaikia:fix-process-templates-folder
Open

fix: include rendered templates in helm manifest generation#878
parthivsaikia wants to merge 3 commits intomeshery:masterfrom
parthivsaikia:fix-process-templates-folder

Conversation

@parthivsaikia
Copy link
Member

Description
This PR updates GetManifestsFromHelm to correctly render Helm chart templates instead of only retrieving CRDs. Previously, the function ignored the templates/ directory, which caused "no components found" errors during model generation because standard resources (Deployments, Services, etc.) were missing.

This PR fixes #877

Signed commits

  • Yes, I signed my commits.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @parthivsaikia, 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 significantly enhances the Helm manifest generation process by ensuring that GetManifestsFromHelm correctly renders and includes all components defined within a Helm chart's templates/ directory, in addition to its CRDs. This crucial update resolves a long-standing issue where only CRDs were being processed, leading to incomplete manifest generation and "no components found" errors for standard Kubernetes resources. The change guarantees a comprehensive and accurate representation of Helm chart deployments.

Highlights

  • Helm Template Rendering: The GetManifestsFromHelm function has been updated to correctly render all Helm chart templates, ensuring that standard Kubernetes resources like Deployments and Services are included in the generated manifests.
  • CRD and Template Inclusion: The function now explicitly includes both Custom Resource Definitions (CRDs) and the rendered Kubernetes resource templates, addressing a previous issue where only CRDs were retrieved.
  • Error Resolution: This change resolves the "no components found" errors that occurred during model generation due to the omission of resources from the templates/ directory.
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
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 updates GetManifestsFromHelm to render Helm chart templates in addition to CRDs, addressing a key functionality gap. The implementation is sound, using strings.Builder for efficiency and proper error wrapping. My review focuses on improving the function's reusability and robustness. I've suggested making the Helm release options and values configurable to increase flexibility. Additionally, I've recommended enhancing the manifest filtering to exclude Helm test files, which will make the output more predictable for consumers.

Comment on lines 24 to 36
releaseOptions := chartutil.ReleaseOptions{
Name: "meshery-helm-release",
Namespace: "default",
Revision: 1,
IsInstall: true,
}
manifests := ""

caps := chartutil.DefaultCapabilities

values, err := chartutil.ToRenderValues(chart, chartutil.Values{}, releaseOptions, caps)
if err != nil {
return "", ErrApplyHelmChart(fmt.Errorf("failed to generate render values: %w", err))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The function currently uses hardcoded releaseOptions (like release name and namespace) and always renders the chart with empty values (chartutil.Values{}). This limits the function's flexibility, as it's not possible to specify a different release name, namespace, or provide custom values for template rendering, which are common requirements when working with Helm.

To improve reusability, consider making these configurable. You could introduce an options struct to pass these values into the function. This would make the function much more versatile for use in a library.

Signed-off-by: PARTHIV PRATIM SAIKIA <parthivsaikia985@gmail.com>
@parthivsaikia parthivsaikia force-pushed the fix-process-templates-folder branch from 07fc8dd to ec7bbb7 Compare December 22, 2025 06:19
Signed-off-by: PARTHIV PRATIM SAIKIA <parthivsaikia985@gmail.com>
Copy link
Member

@leecalcote leecalcote left a comment

Choose a reason for hiding this comment

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

@parthivsaikia this seems like a lot of custom code for something that we should be getting from the Helm go client without having to reinvent the wheel on our own. @aabidsofi19

@leecalcote leecalcote requested a review from aabidsofi19 January 2, 2026 05:18
@parthivsaikia
Copy link
Member Author

I have used helm client in most places but I will try to refactor it further if possible.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GetManifestsFromHelm only returns CRDs and ignores chart templates

2 participants