Skip to content

copying chart.template to fix helm unit test#578

Closed
hjoshi123 wants to merge 1 commit intocert-manager:mainfrom
hjoshi123:fix/chart-template-helm
Closed

copying chart.template to fix helm unit test#578
hjoshi123 wants to merge 1 commit intocert-manager:mainfrom
hjoshi123:fix/chart-template-helm

Conversation

@hjoshi123
Copy link
Copy Markdown
Contributor

This PR aims to improve the previous helm-unittest PR by copying the helm chart into a temp directory within _bin ($(bin_dir)). This allows us to replace the templated variables within Chart.template.yaml (if present) so that unit tests can be run. Without this helm-unittest will throw an error claiming there's no Chart.yaml.

@cert-manager-prow cert-manager-prow bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Apr 6, 2026
@cert-manager-prow
Copy link
Copy Markdown
Contributor

[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 inteon 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

@cert-manager-prow cert-manager-prow bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 6, 2026
@ThatsMrTalbot
Copy link
Copy Markdown
Contributor

In the cert-manager repo make helm-chart should build the helm chart into the _bin dir. Instead of recreating that logic you could instead expose a way of making the unit tests depend on this target then test against that?

@hjoshi123
Copy link
Copy Markdown
Contributor Author

@ThatsMrTalbot I thought about that but I wanted to make a uniform approach so that we can use makefile-modules and eventually use makefile-modules for all helm stuff instead of manifest.mk in cert-manager.

@erikgb / @ThatsMrTalbot alternatively I could edit the helm_chart_archive to handle the Chart.template.yaml too. How does that sound?

@ThatsMrTalbot
Copy link
Copy Markdown
Contributor

I wanted to make a uniform approach so that we can use makefile-modules and eventually use makefile-modules for all helm stuff instead of manifest.mk in cert-manager.

I think that is a good end goal, dunno if it should be in scope for this.


How I would tackle this:

  • Update the cert-manager repo to also copy the test files to _bin/helm/cert-manager - code here
  • Update the cert-manager repo to copy the .helmignore to _bin/helm/cert-manager - looks like we forgot to do this, but did not notice because we only copy specific files anyway
  • The .helmignore will prevent the unit tests getting packaged into the tgz, while still being available in _bin/helm/cert-manager
  • In the helm unit test target, add a variable we can use to specify "dependencies", in cert-manager we can use this to make helm-chart a dependency ensuring _bin/helm/cert-manager gets constructed before tests run. Doing it this way makes the helm-unittest targets work in both cert-manager and pure makefile-module repos.

@cert-manager-prow cert-manager-prow bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 7, 2026
Signed-off-by: hjoshi123 <mail@hjoshi.me>
@hjoshi123 hjoshi123 force-pushed the fix/chart-template-helm branch from 55b2210 to 4cb14ed Compare April 7, 2026 14:11
@cert-manager-prow cert-manager-prow bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 7, 2026
@hjoshi123
Copy link
Copy Markdown
Contributor Author

Closing this as we decided to convert Chart.template.yaml in cm to a static file as discussed here: https://kubernetes.slack.com/archives/CDEQJ0Q8M/p1775445108886909

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

Labels

dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants