@narendran-kannan I will handle this, thanks for the ping.
@afaras72 can you share with me the configuration that breaks the template in your case? It would help me identify if there are additional factors that cause your problem.
What configuration do you use? (helm values)
What is the output of the helm template command?
helm template .-s charts/gitlab/charts/toolbox/templates/deployment.yaml
Grigoris Thanasoulas (df501c97) at 18 Mar 16:13
Grigoris Thanasoulas (d09420d6) at 18 Mar 16:12
Merge branch 'cater-claude-files' into 'main'
... and 1 more commit
@Alexand can you review as a maintainer?
'gitlab.nodeSelector' is incorrectly included in the volumes block instead of at the pod spec level
For general guidance, please follow our Contributing guide.
For anything in this list which will not be completed, please provide a reason in the MR discussion.
LGTM, we can merge the existing improvements.
The same fix needs to be implemented in `charts/gitlab/charts/gitlab-exporter/templates/deployment.yaml` in a subsequent MR (see previous comment).
To unblock this MR, we will merge the existing incremental changes.
@cnowicki could you send an extra MR updating the charts/gitlab/charts/gitlab-exporter/templates/deployment.yaml file? Thank you for your contribution.
Grigoris Thanasoulas (1d4cfe17) at 18 Mar 14:44
This is a temporary workaround until `glab` is updated to handle the new URL format.
Co-Authored-By: Claude Sonnet 4.6 [email protected]
Grigoris Thanasoulas (cbd4fef6) at 18 Mar 14:44
Merge branch 'fix-work-items-url-in-cleanup' into 'main'
... and 1 more commit
LGTM.
The syntax of the hasKey expression is not correct, please consult the official Helm docs for the right usage.
You can ensure that the changes work as expected by rendering the helm template using the helm template command. Shall you need any help for this, please let me know.
The syntax of the expression is not correct, please refer to the official docs https://helm.sh/docs/chart_template_guide/function_list/#haskey or my review comment for the correct syntax.
@brookelew I realized there is an edge case where the current with or if expressions will not behave as expected:
revisionHistoryLimit field the k8s docs read: "Explicitly setting this field to 0, will result in cleaning up all the history of your Deployment thus that Deployment will not be able to roll back". So from a Kubernetes perspective, 0 is a perfectly valid value for this field.with or {{- if .Values.deployment.revisionHistoryLimit }}), and the value is set to 0, the template engine will skip the block completely and will not render the field. Kubernetes will then fall back to the server-side default, which is 10.We could mitigate this issue using if hasKey instead:
{{- if hasKey .Values.deployment "revisionHistoryLimit" }}
Thank you for implementing all the suggestions, great job @brookelew!
Indeed, the rest of the file uses the if style. There is no need to update the rest for now, let's keep the scope of this MR narrow.
Non-blocking: The int casting is a good defensive approach, however we want to move towards upfront validation by the Helm schema, which will ensure the value is already of the correct type, so it could optionally be removed.