<p>this is most likely really simple but I can't figure it out for 2 hours now. I have the following Consul Ingress that I want to parameterize through a parent chart:</p>

<pre><code>spec:
  rules:
  {{- range .Values.uiIngress.hosts }}
    - host: {{ . }}
      http:
        paths:
          - backend:
              serviceName: {{ $serviceName }}
              servicePort: {{ $servicePort }}
  {{- end -}}
  {{- if .Values.uiIngress.tls }}
  tls:
{{ toYaml .Values.uiIngress.tls | indent 4 }}
  {{- end -}}
{{- end }}
</code></pre>

<p>I want to parameterize <code>spec.tls</code> in the above.</p>

<p>In the <code>values.yaml</code> file for Consul we have the following template for it:</p>

<pre><code>uiIngress:
  enabled: false
  annotations: {}
  hosts: []
  tls: {}
</code></pre>

<p>The closest I got to parameterizing it is the following:</p>

<pre><code>  uiIngress:
    tls:
    - hosts:
      - "some.domain.com"
    secretName: "ssl-default"
</code></pre>

<p>When I do that I get this error though:</p>

<p><code>warning: cannot overwrite table with non table for tls (map[])</code></p>

<p>Can someone please help, I tried a million things.</p>

<p>If your default configuration values for this chart that are defined in the <code>values.yaml</code> file for Consul has this structure:</p>
<pre><code>uiIngress:
  enabled: false
  annotations: {}
  hosts: []
  tls: {}
</code></pre>
<p>And when you are executing <code>helm</code> command you are sending values like this:</p>
<pre><code>  uiIngress:
    tls:
    - hosts:
      - &quot;some.domain.com&quot;
    secretName: &quot;ssl-default&quot;
</code></pre>
<p>The error <code>warning: cannot overwrite table with non table for tls (map[])</code> is happening because of the fact that <code>tls</code> is defined as a dict <code>{}</code> in the <code>values.yaml</code> and you are trying to set value with the type list <code>[]</code>(<code>- hosts:</code>) to it.
To fix the warning you can change provided <code>values.yaml</code> format to:</p>
<pre><code>uiIngress:
  enabled: false
  annotations: {}
  tls: []
    hosts: []
</code></pre>
