Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Helm: Cannot overwrite table with non table for tls

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:

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 }}

I want to parameterize spec.tls in the above.

In the values.yaml file for Consul we have the following template for it:

uiIngress:
  enabled: false
  annotations: {}
  hosts: []
  tls: {}

The closest I got to parameterizing it is the following:

  uiIngress:
    tls:
    - hosts:
      - "some.domain.com"
    secretName: "ssl-default"

When I do that I get this error though:

warning: cannot overwrite table with non table for tls (map[])

Can someone please help, I tried a million things.

like image 579
Neekoy Avatar asked Oct 20 '25 14:10

Neekoy


1 Answers

If your default configuration values for this chart that are defined in the values.yaml file for Consul has this structure:

uiIngress:
  enabled: false
  annotations: {}
  hosts: []
  tls: {}

And when you are executing helm command you are sending values like this:

  uiIngress:
    tls:
    - hosts:
      - "some.domain.com"
    secretName: "ssl-default"

The error warning: cannot overwrite table with non table for tls (map[]) is happening because of the fact that tls is defined as a dict {} in the values.yaml and you are trying to set value with the type list [](- hosts:) to it. To fix the warning you can change provided values.yaml format to:

uiIngress:
  enabled: false
  annotations: {}
  tls:
  - hosts: []
like image 89
Aleksandr Podkutin Avatar answered Oct 22 '25 10:10

Aleksandr Podkutin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!