Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect Chart Annotations: Make it possible to create custom template with the Chart.yaml annotations #287

Open
gerardnico opened this issue Mar 10, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@gerardnico
Copy link

I have searched intensively how I could use the annotations field of Chart.yaml and I could find anything.

This issue is more a sort of request doubled with a documentation over a solution.

Case

We set a metadata in the annotations field of Chart.yaml
and we want to create custom template such as:

{{- if eq ( index .Annotations "chart.kubee/status") "alpha" }}
> [!WARNING]
> This chart is in the {{ template "kubee-chart-status-label" "alpha status" }} and is not fit to be installed.
{{-end }}

Expected Behavior

Should work

Current Behavior

Does not work

Possible Solution

  • Collect the annotations in the .Annotations field
  • Uses .Files.Get to parse it again.
{{ $chartYaml := (.Files.Get "Chart.yaml") | fromYaml }}
{{- if eq (index $chartYaml.annotations "chart.kubee/status") "alpha" }}
> [!WARNING]
> This chart is in the {{ template "kubee-chart-status-label" "alpha status" }} and is not fit to be installed.
{{- end }}

This solution works but I was expecting the whole Chart.yaml to be available, the Helm ways. ie .Chart.Name, .Values.

@gerardnico gerardnico added the enhancement New feature or request label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants