redpanda-data / helm-charts

Redpanda Helm Chart
http://redpanda.com
Apache License 2.0
75 stars 96 forks source link

redpanda chart 5.8.12 requires helm built with go >= 1.19.x #1454

Closed saikiran1208 closed 2 months ago

saikiran1208 commented 2 months ago

What happened?

I am getting below error when trying to upgrade Redpanda using helm, trying to upgrade from 5.7.33 to 5.8.12

failed exit status 1: Error: template: redpanda/charts/redpanda/templates/tests/test-schemaregistry-status.yaml:26:11: executing "redpanda/charts/redpanda/templates/tests/test-schemaregistry-status.yaml" at <include "full.labels" .>: error calling include: template: redpanda/charts/redpanda/templates/_helpers.tpl:43:11: executing "full.labels" at <include "redpanda.FullLabels" (dict "a" (list .))>: error calling include: template: redpanda/charts/redpanda/templates/_helpers.go.tpl:46:8: executing "redpanda.FullLabels" at <ne $values.commonLabels (coalesce nil)>: error calling ne: uncomparable type map[string]interface {}: map[app:redpanda] Use --debug flag to render out invalid YAML

values.yaml commonLabels: app: "redpanda"

image

What did you expect to happen?

Expect the labels to apply without any issues

How can we reproduce it (as minimally and precisely as possible)?. Please include values file.

redpanda: commonLabels: app: "redpanda" ```console $ helm upgrade --install values -n --all # paste output here ```

Anything else we need to know?

No response

Which are the affected charts?

No response

Chart Version(s)

5.8.12

Cloud provider

Azure AKS

JIRA Link: K8S-306

dmavrommatis commented 2 months ago

having the same issue even without defining the commonLabels field on github-action runner.

runner@testing-arc-runner-qtqbg-runner-dgvvh:~/_work/platform/platform$ cat tmp.yaml 
fullnameOverride: redpanda
commonLabels: {}
...
runner@testing-arc-runner-qtqbg-runner-dgvvh:~/_work/platform/platform$ helm template -n pr-23133 redpanda redpanda/redpanda -f tmp.yaml
Error: template: redpanda/templates/statefulset.yaml:21:18: executing "redpanda/templates/statefulset.yaml" at <include "redpanda.StatefulSet" (dict "a" (list .))>: error calling include: template: redpanda/templates/_statefulset.go.tpl:499:653: executing "redpanda.StatefulSet" at <include "redpanda.FullLabels" (dict "a" (list $dot))>: error calling include: template: redpanda/templates/_helpers.go.tpl:55:8: executing "redpanda.FullLabels" at <ne $values.commonLabels (coalesce nil)>: error calling ne: uncomparable type map[string]interface {}: map[]
chrisseto commented 2 months ago

Could you both share the output of helm version? We've seen some similar issues due to older versions of helm built on older versions of go. I'll try to track down the original issue.

Here's the version we develop on:

version.BuildInfo{Version:"v3.15.3", GitCommit:"v3.15.3", GitTreeState:"", GoVersion:"go1.22.5"}
dmavrommatis commented 2 months ago

Current worker's helm version

runner@testing-arc-runner-qtqbg-runner-nzcm8:~/_work/_tool/helm/3.11.0/x64/linux-amd64$ ./helm version
version.BuildInfo{Version:"v3.11.0", GitCommit:"472c5736ab01133de504a826bd9ee12cbe4e7904", GitTreeState:"clean", GoVersion:"go1.18.10"}

Upgrading the helm version on the runner fixed the issue

saikiran1208 commented 2 months ago

We use agrocd for deploying Redpanda, version used is: argocd: v2.6.2+6e02f8b BuildDate: 2023-02-16T15:26:43Z GitCommit: 6e02f8b23201b0620a4ff1bce5d38229ba1eb02e GitTreeState: clean GoVersion: go1.18.10 Compiler: gc Platform: linux/amd64 argocd-server: v2.6.4+7be094f

chrisseto commented 2 months ago

Here we go: https://github.com/redpanda-data/helm-charts/issues/1198 and https://github.com/redpanda-data/helm-charts/issues/1128

The root cause is actually the version of go that's used to compile helm. The exact error your seeing seems to be a touch different from the aforementioned issues but the linked commit (https://github.com/golang/go/commit/c58f1bb65f2187d79a5842bb19f4db4cafd22794) wasn't introduced until go1.19. So I think it's safe to say it's the same issue.

@saikiran1208 upgrading to anything that was built with a newer version of go should do the trick. IIRC argo shells out to helm instead of fully vendoring the project (I could be mistaken though), so make sure to check that argo's version of helm is updated to a newer version as well.