-
Notifications
You must be signed in to change notification settings - Fork 148
Description
Helm Template Error: elasticsearch.commonLabels Type Mismatch
Describe the issue:
Helm template error occurs when deploying Camunda Platform with external Elasticsearch configuration where the elasticsearch section only contains enabled: false without the required commonLabels field.
Actual behavior:
Helm deployment fails with the following error:
Error: UPGRADE FAILED: template: camunda-platform/templates/z/1/2/3/4/5/6/7/8/z_compatibility_helpers.tpl:471:30: executing "camunda-platform/templates/z/1/2/3/4/5/6/7/8/z_compatibility_helpers.tpl" at <.Values.elasticsearch.commonLabels>: wrong type for value; expected map[string]interface {}; got interface {}
Expected behavior:
Helm deployment should succeed even when elasticsearch.enabled is set to false and external Elasticsearch is used through operators (like ECK).
How to reproduce:
- Create a values file with external Elasticsearch configuration
- Set
elasticsearch.enabled: falsewithout definingcommonLabels - Deploy using Helm:
helm upgrade --install camunda oci://ghcr.io/camunda/helm/camunda-platform - The deployment fails with the template error
Example problematic configuration:
global:
elasticsearch:
enabled: true
external: true
# ... other config
elasticsearch:
enabled: false # Missing commonLabels fieldLogs:
Error: UPGRADE FAILED: template: camunda-platform/templates/z/1/2/3/4/5/6/7/8/z_compatibility_helpers.tpl:471:30: executing "camunda-platform/templates/z/1/2/3/4/5/6/7/8/z_compatibility_helpers.tpl" at <.Values.elasticsearch.commonLabels>: wrong type for value; expected map[string]interface {}; got interface {}
Environment:
- Platform: OpenShift / Kubernetes (operator-based deployment)
- Helm CLI version: 3.x.x
- Chart version: 0.0.0-snapshot-latest (development version)
- Values file: External Elasticsearch configuration with ECK operator
Fix:
Add the commonLabels field as an empty map to the elasticsearch section:
elasticsearch:
enabled: false
commonLabels: {}This ensures the Helm template has the correct data type (map) instead of defaulting to interface{} when the field is undefined.
Root Cause:
The Helm template z_compatibility_helpers.tpl at line 471 expects .Values.elasticsearch.commonLabels to be a map type, but when this field is not explicitly defined in the values file, it defaults to an interface{} type, causing the template rendering to fail.
Solution Applied:
Modified the values.yml file to include the missing commonLabels field with an empty map value, ensuring proper type compatibility with the Helm template expectations.
PR: #4180