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

Enable filtering valuesTable to a subset of values #156

Open
colearendt opened this issue Jun 17, 2022 · 0 comments
Open

Enable filtering valuesTable to a subset of values #156

colearendt opened this issue Jun 17, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@colearendt
Copy link

In the couchdb helm chart, values are segregated into subsections that are relevant to one another.

This can be a very useful pattern to highlight values appropriate in particular contexts, and cuts down on the "overload" that can happen with a giant values table.

It would be nice to auto-generate these sub-sections, which requires some type of change to helm-docs AFAICT (the workaround is currently to overload the charts.valuesTable definition and do a bunch of manual if/else checking).

It would be ideal to expose this functionality to the user (i.e. does not need to be a dedicated feature in helm-docs), although a feature / dedicated template here may be nice as well.

I believe #155 would provide a solution with omit, in particular (although this would probably need to be within the range since "filtering" an array is tricky). Perhaps something like this from the user's perspective could work (pseudocode):

{{- $sectionKeys := list "One" "Two" "Three.Four" }}
{{- $tmpValues := list }}
{{- range .Values }}
  {{- if has $sectionKeys .Key }}
    {{- $tmpValues := append $tmpValues (deepCopy .) }}
  {{- end }}
{{- end }}
{{ $section := deepCopy . }}

{{ $section.Values = $tmpValues }}
{{ template "chart.valuesTable" $section }}
@Nepo26 Nepo26 added the enhancement New feature or request label Jun 29, 2023
@Nepo26 Nepo26 changed the title [Feature Request] Enable filtering valuesTable to a subset of values Enable filtering valuesTable to a subset of values Jun 29, 2023
@Nepo26 Nepo26 added this to the General Cleanup milestone Jul 25, 2023
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
Status: No status
Development

No branches or pull requests

2 participants