Resolve error can't give argument to non-function hasKey

8/6/2021

I wasn't able to find any information regarding this error; I'm trying to install GitLab specific version (12.7.5) with helm chart ( v3.0.3 ) and keep receiving this error.

Error: template: gitlab/templates/NOTES.txt:39:3: executing "gitlab/templates/NOTES.txt" at <include "gitlab.deprecations" .>:
error calling include: template: gitlab/templates/_deprecations.tpl:31:39:
executing "gitlab.deprecations" at <include "gitlab.deprecate.registry.replicas" .>:
error calling include: template: gitlab/templates/_deprecations.tpl:135:7:
executing "gitlab.deprecate.registry.replicas" at <(hasKey .Values.registry "minReplicas") or (hasKey .Values.registry "maxReplicas")>: can't give argument to non-function hasKey .Values.registry "minReplicas"
helm.go:88: debug template: gitlab/templates/NOTES.txt:39:3: executing "gitlab/templates/NOTES.txt" at <include "gitlab.deprecations" .>:
error calling include: template: gitlab/templates/_deprecations.tpl:31:39:
executing "gitlab.deprecations" at <include "gitlab.deprecate.registry.replicas" .>:
error calling include: template: gitlab/templates/_deprecations.tpl:135:7: executing "gitlab.deprecate.registry.replicas" at <(hasKey .Values.registry "minReplicas") or (hasKey .Values.registry "maxReplicas")>:
can't give argument to non-function hasKey .Values.registry "minReplicas"

Can someone please tell me how can I handle this?

Helm Version \ {Version:"v3.6.3", GitCommit:"d506314abfb5d21419df8c7e7e68012379db2354", GitTreeState:"clean", GoVersion:"go1.16.5"}

Kubernetes Version \ Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:59:11Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.6", GitCommit:"dff82dc0de47299ab66c83c626e08b245ab19037", GitTreeState:"clean", BuildDate:"2020-07-15T16:51:04Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

-- Ruben
gitlab
kubernetes
kubernetes-helm

1 Answer

8/10/2021

It turns out that there is bug in that particular version of helm chart (v3.0.3)

-- Ruben
Source: StackOverflow