Skip to content

[Bug]: Cannot override .Values.services.neo4j.cleanup.image.tag #454

@senyahnoj

Description

@senyahnoj

Contact Details

senyahnoj@gmail.com

What happened?

Background

I'm using the "neo4j" helm chart and trying to override the version of the bitnami kubectl image which is used in the delete hook for the load balancer service.

To reproduce

To demonstrate the problem in the root of the checked out repository I am running

helm template neo4j --set neo4j.name=test --set volumes.data.mode=dynamic --set neo4j.minimumClusterSize=3 --set neo4j.edition=enterprise --set neo4j.acceptLicenseAgreement=yes --set services.neo4j.cleanup.image.tag=1.33.1 | grep image:

Here is the output, you can see that it isn't using the 1.33.1 tag as per my configuration

Image

The line to fix

There is a variable scoping bug in the template function "cleanup.image"

https://github.com/neo4j/helm-charts/blob/dev/neo4j/templates/_image.tpl#L36

Specifically, within the following section

{{- $termination := printf "%s.%s" $.Capabilities.KubeVersion.Major (regexReplaceAll "\\D+" $.Capabilities.KubeVersion.Minor "") -}}
{{- if not (empty (.tag | trim)) -}}
    {{- $termination := .tag | toString -}}
{{- end -}}

the bit inside the if block should be modifying the outer $termination not creating a new local $termination variable.

So instead of

{{- $termination := .tag | toString -}}

it should be

{{- $termination = .tag | toString -}}

When I make that change in my locally checked out copy, it fixes the problem:

Image

Chart Name

Neo4j

Chart Version

5.12.0

Environment

Local Machine

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions