bjw-s / helm-charts

A collection of Helm charts
https://bernd-schorgers.github.io/helm-charts/
Apache License 2.0
566 stars 106 forks source link

expected map[string]interface {}; got bool in _ports.tpl #163

Closed colbyshores closed 1 year ago

colbyshores commented 1 year ago

Details

receiving an error expected map[string]interface {}; got bool in library/common/templates/lib/container/_ports.tpl. Upon closer inspection of the code, it appears that {{- $serviceEnabled = $service.enabled -}} on line 9 is missing :=

Another thing I noticed is that $serviceEnabled is being set to true on line 7, so that would make that cast as a bool twice.

I don't use helm very often, especially on such detailed library so I could be mistaken here.

What steps did you take and what happened:

I am using the xbvr helm chart which relies on this library as a submodule.

I am passing in the following in to .values in terraform

` set { name = "service.enabled" value = "true" }

set { name = "service.type" value = "loadBalancer" }

set { name = "service.loadBalancerIP" value = "${var.loadBalancerIP}" } `

What did you expect to happen:

I expected the flags set to configure to metallb with a fixed ip address and enable the service

Anything else you would like to add:

Here is the full error that I have received: │ Error: template: xbvr/templates/common.yaml:1:4: executing "xbvr/templates/common.yaml" at <include "bjw-s.common.loader.all" .>: error calling include: template: xbvr/charts/common/templates/loader/_all.tpl:9:6: executing "bjw-s.common.loader.all" at <include "bjw-s.common.loader.generate" .>: error calling include: template: xbvr/charts/common/templates/loader/_generate.tpl:23:6: executing "bjw-s.common.loader.generate" at <include "bjw-s.common.render.controller" .>: error calling include: template: xbvr/charts/common/templates/render/_controller.tpl:7:10: executing "bjw-s.common.render.controller" at <include "bjw-s.common.class.deployment" .>: error calling include: template: xbvr/charts/common/templates/classes/_deployment.tpl:54:10: executing "bjw-s.common.class.deployment" at <include "bjw-s.common.lib.controller.pod" .>: error calling include: template: xbvr/charts/common/templates/lib/controller/_pod.tpl:70:6: executing "bjw-s.common.lib.controller.pod" at <include "bjw-s.common.lib.controller.mainContainer" .>: error calling include: template: xbvr/charts/common/templates/lib/controller/_mainContainer.tpl:45:12: executing "bjw-s.common.lib.controller.mainContainer" at <include "bjw-s.common.lib.container.ports" .>: error calling include: template: xbvr/charts/common/templates/lib/container/_ports.tpl:8:18: executing "bjw-s.common.lib.container.ports" at <$service>: wrong type for value; expected map[string]interface {}; got bool