Skip to content

[housekeeping] Add docs about tpl function used for rendering template fields in such charts as raw #170

Description

@MaxymVlasov

Thank you so much for your work!
A have a few suggestions, based on my current struggle, how this project can get much wider adoption.

Is your feature request related to a problem? What would you like to improve?

Docs. Without good docs, charts are barely used by outsiders, as there is too much tribal knowledge which I can't easily access.

Describe the solution you'd like

Write/generate docs about how to use existing functionality, especially templates in raw

Additional context

All what I want - is just provide value inside raw.templates.[]. using some helm(?) interpolation.

But all attempts failed:

  1. Based on raw README, I created a minimum reproducible configuration:
image:
  registry: docker.io

raw:
  templates:
    - |
      apiVersion: v1
      kind: Service
      metadata:
        name: foo
        namespace: bar
        labels:
          exampleLabel: {{ .Values.image.registry }} 

And it just breaks ArgoCD deployment:

Image
  1. If use next value, directly from template
exampleLabel: \{\{ include "lib.utils.globals.image" (dict "image" .Values.image "context" $ ) }}

it will not render at all (will just literally \{\{ include "lib.utils.globals.image" (dict "image" .Values.image "context" $ ) }} inside input parameters)

  1. I tried to use
exampleLabel: {{ include "lib.utils.globals.image" (dict "image" .Values.image "context" $ ) }}

but this time it says that there is no such library as lib.utils.globals.image, and I can't find out any docs about this as well. Is I should install something? Or I need to create in values.yaml something like this:

{{/*
Sprig Template - CommonLabels Wrapper. Adds Bundlename to CommonLabels, if defined.
*/}}
{{- define "bedag-lib.utils.common.commonLabels" -}}
{{- include "lib.utils.common.commonLabels" . | indent 0 }}
{{- if .bundlename }}
app.kubernetes.io/bundle: {{ .bundlename }}
{{- end }}
{{- end -}}

I am not sure.

3.1. Also

# templates -- Define templates which will be executed using the `tpl` function
templates: []

says that there some tpl function involved, but I can't find it, nor docs for how it works

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions