<p>im currently going through the docs of helm, and there have been at least 3 different uses for the dot (.), is there any specific definition for it? and does it have something in common with the bash use (actual folder/files)?</p>

<p>some cases in the documentation </p>

<p>This print the accesed files in the range called before?</p>

<pre><code>  {{- $files := .Files }}
  {{- range tuple "config1.toml" "config2.toml" "config3.toml" }}
  {{ . }}: |-
    {{ $files.Get . }}
  {{- end }}
</code></pre>

<p>This tells "mychart.app" to use the files in the current folder (bash-like behaviour)</p>

<pre><code>{{ include "mychart.app" . | indent 4 }}
</code></pre>

<p>and this, i guess it takes the values from the whole folder??? i guess this is not correct since is not working (it has been made by another employee back then and i have to fix it)</p>

<pre><code>{{- define "read.select-annot" -}}
{{- range $key, $value := . }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
</code></pre>

<p>thanks for the help</p>

Juan.
<p>In general, <code>.</code> in Helm templates has nothing to do with files or directories.</p>

<p>The Helm templating language uses Go's <a href="https://godoc.org/text/template" rel="noreferrer">text/template</a> system.  There are a couple of different ways a period character can appear there.</p>

<p>First of all, <code>.</code> can be a character in a string:</p>

<pre class="lang-none prettyprint-override"><code>{{- range tuple "config1.toml" "config2.toml" "config3.toml" }}
{{/*             ^^^^^^^^^^^^
       this is a literal string "config1.toml"             */}}
...
{{- end }}
</code></pre>

<p>Secondly, <code>.</code> can be a lookup operator.  There aren't any solid examples in your question, but a typical use is looking up in values.  If your <code>values.yaml</code> file has</p>

<pre><code>root:
  key: value
</code></pre>

<p>then you can expand</p>

<pre class="lang-none prettyprint-override"><code>{{ .Values.root.key }}
</code></pre>

<p>and the <code>.</code> before <code>root</code> and <code>key</code> navigates one level down in the dictionary structure.</p>

<p>The third use, and possibly the one that's confusing you, is that <code>.</code> on its own is a variable.</p>

<pre class="lang-none prettyprint-override"><code>{{ . }}
</code></pre>

<p>You can do field lookups on it, and you have some examples of that: <code>.Files</code> is the same as <code>index . "Files"</code>, and looks up the field "Files" on the object <code>.</code>.</p>

<p>You use <code>.</code> as a variable in several places:</p>

<pre class="lang-none prettyprint-override"><code>{{- $files := .Files }}        {{/* Get "Files" from . */}}
{{ . }}                        {{/* Write . as a value */}}
{{ include "mychart.app" . }}  {{/* Pass . as the template parameter */}}
</code></pre>

<p><code>.</code> is tricky in that it has somewhat contextual meaning:</p>

<ul>
<li>At the top level, <a href="https://docs.helm.sh/docs/chart_template_guide/builtin_objects/" rel="noreferrer">Helm initializes <code>.</code> to an object</a> with keys <code>Files</code>, <code>Release</code>, <code>Values</code>, and <code>Chart</code>.</li>
<li>In a <code>define</code>d template, <code>.</code> is the parameter to the template.  (So when you <code>include</code> or <code>template</code>, you need to pass <code>.</code> down as that parameter.)</li>
<li>In a <code>range</code> loop, <code>.</code> is the current item being iterated on.</li>
<li>In a <code>with</code> block, <code>.</code> is the matched item if it exists.</li>
</ul>

<p>In particular, the interaction with <code>range</code> can be tricky.  Let's look at a simplified version of your loop:</p>

<pre class="lang-none prettyprint-override"><code># {{ . }}
{{- range tuple "config1.toml" "config2.toml" "config3.toml" }}
- {{ . }}
{{- end }}
</code></pre>

<p>Outside the <code>range</code> loop, <code>.</code> is probably the top-level Helm object.  But inside the <code>range</code> loop, <code>.</code> is the file name (each value from the <code>tuple</code> in turn).  That's where you need to save values from <code>.</code> into local variables:</p>

<pre class="lang-none prettyprint-override"><code>{{/* We're about to invalidate ., so save .Files into a variable. */}}
{{- $files := .Files }}

{{- range tuple "config1.toml" "config2.toml" "config3.toml" }}
{{/* This . is the filename from the "tuple" call */}}
{{ . }}: |-
  {{/* Call .Get, from the saved $files, passing the filename .
       as the parameter */}}
  {{ $files.Get . }}
{{- end }}
</code></pre>
