fix(openshift): when es is disabled, fix templating error of label#5020
Open
leiicamundi wants to merge 3 commits intomainfrom
Open
fix(openshift): when es is disabled, fix templating error of label#5020leiicamundi wants to merge 3 commits intomainfrom
leiicamundi wants to merge 3 commits intomainfrom
Conversation
jessesimpson36
approved these changes
Jan 22, 2026
684699f to
0471bcd
Compare
Contributor
|
I think the CI failures were unrelated so I'm rebasing so they rerun |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which problem does the PR fix?
closes #2779
Fixes Helm chart rendering failure when deploying on OpenShift with Elasticsearch disabled:
This occurs with values like:
Root cause: The
hasKeyfunction was called on.Values.elasticsearch.commonLabelswithout ensuring it was a proper map. When elasticsearch was disabled without explicitly definingcommonLabels: {}, the value becamenilcausing the template to fail.What's in this PR?
Updated the compatibility helpers in charts 8.6 and 8.7 to match the already-correct implementation in 8.8/8.9:
and(elasticsearch.enabledANDadaptSecurityContext == "force")commonLabelskey exists, create empty dict if nottuned.openshift.io/elasticsearchlabelBefore:
{{- if .Values.elasticsearch.enabled -}} {{- if eq .Values.global.compatibility.openshift.adaptSecurityContext "force" -}} {{- if not (hasKey .Values.elasticsearch.commonLabels "tuned.openshift.io/elasticsearch") -}} {{- $_ := set .Values.elasticsearch.commonLabels "tuned.openshift.io/elasticsearch" "" -}} {{- end -}} {{- end -}} {{- end -}}After:
{{- if and (eq .Values.global.compatibility.openshift.adaptSecurityContext "force") .Values.elasticsearch.enabled -}} {{- if not (hasKey .Values.elasticsearch "commonLabels") -}} {{- $_ := set .Values.elasticsearch "commonLabels" (dict) -}} {{- end -}} {{- if not (hasKey .Values.elasticsearch.commonLabels "tuned.openshift.io/elasticsearch") -}} {{- $_ := set .Values.elasticsearch.commonLabels "tuned.openshift.io/elasticsearch" "" -}} {{- end -}} {{- end -}}Files changed:
templates/zeebe/1/2/3/4/5/6/7/8/z_compatibility_helpers.tpltemplates/zeebe/1/2/3/4/5/6/7/8/z_compatibility_helpers.tplUnit tests added:
test/unit/camunda/compatibility_helpers_test.gotest/unit/camunda/compatibility_helpers_test.gotest/unit/common/compatibility_helpers_test.gotest/unit/common/compatibility_helpers_test.goChecklist
Please make sure to follow our Contributing Guide.
Before opening the PR:
make go.update-golden-only.After opening the PR: