Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions charts/camunda-platform-8.10/templates/orchestration/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -274,20 +274,7 @@ Authentication.
{{- end -}}


{{- define "orchestration.hasCamundaExporter" -}}
{{- and (not (eq (include "orchestration.secondaryStorage" .) "none")) .Values.orchestration.exporters.camunda.enabled (not .Values.orchestration.exporters.rdbms.enabled) -}}
{{- end -}}

{{- define "orchestration.hasNoExporter" -}}
{{-
and
(ne (include "orchestration.hasLegacyOpenSearchExporter" .) "true")
(ne (include "orchestration.hasLegacyElasticsearchExporter" .) "true")
(ne (include "orchestration.hasCamundaExporter" .) "true")
-}}
{{- end -}}

{{- define "orchestration.hasLegacyElasticsearchExporter" -}}
{{- define "orchestration.hasElasticsearchExporter" -}}
{{- and
(or
(and .Values.global.elasticsearch.enabled .Values.orchestration.exporters.rdbms.enabled .Values.optimize.enabled)
Expand All @@ -303,7 +290,7 @@ and
-}}
{{- end -}}

{{- define "orchestration.hasLegacyOpenSearchExporter" -}}
{{- define "orchestration.hasOpenSearchExporter" -}}
{{- and
(or
(and .Values.global.opensearch.enabled .Values.orchestration.exporters.zeebe.enabled)
Expand All @@ -316,6 +303,14 @@ and
-}}
{{- end -}}

{{- define "orchestration.hasNoExporter" -}}
{{-
and
(ne (include "orchestration.hasOpenSearchExporter" .) "true")
(ne (include "orchestration.hasElasticsearchExporter" .) "true")
-}}
{{- end -}}
Comment on lines +306 to +312

{{- define "orchestration.hasAppIntegrations" -}}
{{- include "camundaPlatform.hasSecretConfig" (dict "config" .Values.orchestration.exporters.appIntegrations.apiKey) -}}
{{- end -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,15 @@ zeebe:
clusterName: {{ tpl .Values.global.zeebeClusterName . }}

{{- if or
(eq (include "orchestration.hasLegacyElasticsearchExporter" .) "true")
(eq (include "orchestration.hasLegacyOpenSearchExporter" .) "true")
(eq (include "orchestration.hasCamundaExporter" .) "true")
(eq (include "orchestration.hasElasticsearchExporter" .) "true")
(eq (include "orchestration.hasOpenSearchExporter" .) "true")
(eq (include "orchestration.hasAppIntegrations" .) "true")
(eq (include "orchestration.hasNoExporter" .) "true")
}}
# zeebe.broker.exporters
exporters: {{- if eq (include "orchestration.hasNoExporter" .) "true" }}{{ printf " %s" "{}" }}{{ end }}
{{- end }}
{{- if eq (include "orchestration.hasLegacyElasticsearchExporter" .) "true" }}
{{- if eq (include "orchestration.hasElasticsearchExporter" .) "true" }}
elasticsearch:
className: "io.camunda.zeebe.exporter.ElasticsearchExporter"
args:
Expand All @@ -350,7 +349,7 @@ zeebe:
minimumAge: {{ .Values.orchestration.retention.minimumAge | quote }}
policyName: {{ .Values.orchestration.retention.policyName | quote }}
{{- end }}
{{- else if eq (include "orchestration.hasLegacyOpenSearchExporter" .) "true" }}
{{- else if eq (include "orchestration.hasOpenSearchExporter" .) "true" }}
opensearch:
className: "io.camunda.zeebe.exporter.opensearch.OpensearchExporter"
args:
Expand All @@ -374,24 +373,6 @@ zeebe:
policyName: {{ .Values.orchestration.retention.policyName | quote }}
{{- end }}
{{- end }}
{{- if eq (include "orchestration.hasCamundaExporter" .) "true" }}
camundaexporter:
className: "io.camunda.exporter.CamundaExporter"
args:
connect:
type: {{ include "orchestration.secondaryStorage" . | quote }}
{{- if .Values.orchestration.index.prefix }}
indexPrefix: {{ .Values.orchestration.index.prefix | quote }}
{{- end }}
awsEnabled: {{ or .Values.orchestration.data.secondaryStorage.opensearch.aws.enabled .Values.global.opensearch.aws.enabled }}
history:
elsRolloverDateFormat: {{ .Values.orchestration.history.elsRolloverDateFormat | quote }}
rolloverInterval: {{ .Values.orchestration.history.rolloverInterval | quote }}
rolloverBatchSize: {{ .Values.orchestration.history.rolloverBatchSize }}
waitPeriodBeforeArchiving: {{ .Values.orchestration.history.waitPeriodBeforeArchiving | quote }}
delayBetweenRuns: {{ .Values.orchestration.history.delayBetweenRuns }}
maxDelayBetweenRuns: {{ .Values.orchestration.history.maxDelayBetweenRuns }}
{{- end }}
{{- if eq (include "orchestration.hasAppIntegrations" .) "true" }}
appIntegrations:
args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,17 @@ func TestGoldenConfigmapWithHistoryRetentionEnabled(t *testing.T) {
func (s *ConfigmapLegacyTemplateTest) TestDifferentValuesInputs() {
testCases := []testhelpers.TestCase{
{
Name: "TestContainerShouldContainExporterClassPerDefault",
Name: "TestExportersShouldBeEmptyByDefault",
Values: map[string]string{},
Verifier: func(t *testing.T, output string, err error) {
var configmap corev1.ConfigMap
var configmapApplication camunda.OrchestrationApplicationYAML
helm.UnmarshalK8SYaml(s.T(), output, &configmap)
helm.UnmarshalK8SYaml(s.T(), configmap.Data["application.yaml"], &configmapApplication)

// then
s.Require().Equal("io.camunda.exporter.CamundaExporter", configmapApplication.Zeebe.Broker.Exporters.CamundaExporter.ClassName)
// CamundaExporter is auto-registered via autoconfigure-camunda-exporter: true;
// the legacy zeebe.broker.exporters.camundaexporter entry must not be present.
s.Require().Empty(configmapApplication.Zeebe.Broker.Exporters.CamundaExporter.ClassName)
},
},
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

**P2 · ** (via correctness)

The only test case in TestDifferentValuesInputs uses empty values and verifies that CamundaExporter.ClassName is absent. There is no test asserting that when orchestration.exporters.camunda.enabled=false the rendered configmap contains autoconfigure-camunda-exporter: "false". With the legacy camundaexporter: block removed, the autoconfigure-camunda-exporter field in camunda.data.secondary-storage is now the sole control surface for opting out of CamundaExporter. A regression here (e.g., the flag being hardcoded or accidentally reversed) would be invisible to the current test suite. The same gap exists in the 8.9 test at charts/camunda-platform-8.9/test/unit/orchestration/configmap_test.go:119. Add a test case with Values: map[string]string{"orchestration.exporters.camunda.enabled": "false"} that asserts autoconfigure-camunda-exporter: false appears in the rendered application.yaml data.

Values: map[string]string{},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,6 @@ data:
cluster:
clusterName: camunda-platform-test-zeebe
# zeebe.broker.exporters
exporters:
camundaexporter:
className: "io.camunda.exporter.CamundaExporter"
args:
connect:
type: "elasticsearch"
awsEnabled: false
history:
elsRolloverDateFormat: "date"
rolloverInterval: "1d"
rolloverBatchSize: 100
waitPeriodBeforeArchiving: "1h"
delayBetweenRuns: 2000
maxDelayBetweenRuns: 60000
exporters: {}

log4j2.xml: |
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,7 @@ data:
cluster:
clusterName: camunda-platform-test-zeebe
# zeebe.broker.exporters
exporters:
camundaexporter:
className: "io.camunda.exporter.CamundaExporter"
args:
connect:
type: "elasticsearch"
awsEnabled: false
history:
elsRolloverDateFormat: "date"
rolloverInterval: "1d"
rolloverBatchSize: 100
waitPeriodBeforeArchiving: "1h"
delayBetweenRuns: 2000
maxDelayBetweenRuns: 60000
exporters: {}

log4j2.xml: |
<xml>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,6 @@ data:
cluster:
clusterName: camunda-platform-test-zeebe
# zeebe.broker.exporters
exporters:
camundaexporter:
className: "io.camunda.exporter.CamundaExporter"
args:
connect:
type: "elasticsearch"
awsEnabled: false
history:
elsRolloverDateFormat: "date"
rolloverInterval: "1d"
rolloverBatchSize: 100
waitPeriodBeforeArchiving: "1h"
delayBetweenRuns: 2000
maxDelayBetweenRuns: 60000
exporters: {}

log4j2.xml: |
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,6 @@ data:
cluster:
clusterName: camunda-platform-test-zeebe
# zeebe.broker.exporters
exporters:
camundaexporter:
className: "io.camunda.exporter.CamundaExporter"
args:
connect:
type: "elasticsearch"
awsEnabled: false
history:
elsRolloverDateFormat: "date"
rolloverInterval: "1d"
rolloverBatchSize: 100
waitPeriodBeforeArchiving: "1h"
delayBetweenRuns: 2000
maxDelayBetweenRuns: 60000
exporters: {}

log4j2.xml: |
25 changes: 10 additions & 15 deletions charts/camunda-platform-8.9/templates/orchestration/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -274,20 +274,7 @@ Authentication.
{{- end -}}


{{- define "orchestration.hasCamundaExporter" -}}
{{- and (not (eq (include "orchestration.secondaryStorage" .) "none")) .Values.orchestration.exporters.camunda.enabled (not .Values.orchestration.exporters.rdbms.enabled) -}}
{{- end -}}

{{- define "orchestration.hasNoExporter" -}}
{{-
and
(ne (include "orchestration.hasLegacyOpenSearchExporter" .) "true")
(ne (include "orchestration.hasLegacyElasticsearchExporter" .) "true")
(ne (include "orchestration.hasCamundaExporter" .) "true")
-}}
{{- end -}}

{{- define "orchestration.hasLegacyElasticsearchExporter" -}}
{{- define "orchestration.hasElasticsearchExporter" -}}
{{- and
(or
(and .Values.global.elasticsearch.enabled .Values.orchestration.exporters.rdbms.enabled .Values.optimize.enabled)
Expand All @@ -303,7 +290,7 @@ and
-}}
{{- end -}}

{{- define "orchestration.hasLegacyOpenSearchExporter" -}}
{{- define "orchestration.hasOpenSearchExporter" -}}
{{- and
(or
(and .Values.global.opensearch.enabled .Values.orchestration.exporters.zeebe.enabled)
Expand All @@ -316,6 +303,14 @@ and
-}}
{{- end -}}

{{- define "orchestration.hasNoExporter" -}}
{{-
and
(ne (include "orchestration.hasOpenSearchExporter" .) "true")
(ne (include "orchestration.hasElasticsearchExporter" .) "true")
-}}
{{- end -}}
Comment on lines +306 to +312

{{- define "orchestration.hasAppIntegrations" -}}
{{- include "camundaPlatform.hasSecretConfig" (dict "config" .Values.orchestration.exporters.appIntegrations.apiKey) -}}
{{- end -}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,15 @@ zeebe:
clusterName: {{ tpl .Values.global.zeebeClusterName . }}

{{- if or
(eq (include "orchestration.hasLegacyElasticsearchExporter" .) "true")
(eq (include "orchestration.hasLegacyOpenSearchExporter" .) "true")
(eq (include "orchestration.hasCamundaExporter" .) "true")
(eq (include "orchestration.hasElasticsearchExporter" .) "true")
(eq (include "orchestration.hasOpenSearchExporter" .) "true")
(eq (include "orchestration.hasAppIntegrations" .) "true")
(eq (include "orchestration.hasNoExporter" .) "true")
}}
# zeebe.broker.exporters
exporters: {{- if eq (include "orchestration.hasNoExporter" .) "true" }}{{ printf " %s" "{}" }}{{ end }}
{{- end }}
{{- if eq (include "orchestration.hasLegacyElasticsearchExporter" .) "true" }}
{{- if eq (include "orchestration.hasElasticsearchExporter" .) "true" }}
elasticsearch:
className: "io.camunda.zeebe.exporter.ElasticsearchExporter"
args:
Expand All @@ -350,7 +349,7 @@ zeebe:
minimumAge: {{ .Values.orchestration.retention.minimumAge | quote }}
policyName: {{ .Values.orchestration.retention.policyName | quote }}
{{- end }}
{{- else if eq (include "orchestration.hasLegacyOpenSearchExporter" .) "true" }}
{{- else if eq (include "orchestration.hasOpenSearchExporter" .) "true" }}
opensearch:
className: "io.camunda.zeebe.exporter.opensearch.OpensearchExporter"
args:
Expand All @@ -374,24 +373,6 @@ zeebe:
policyName: {{ .Values.orchestration.retention.policyName | quote }}
{{- end }}
{{- end }}
{{- if eq (include "orchestration.hasCamundaExporter" .) "true" }}
camundaexporter:
className: "io.camunda.exporter.CamundaExporter"
args:
connect:
type: {{ include "orchestration.secondaryStorage" . | quote }}
{{- if .Values.orchestration.index.prefix }}
indexPrefix: {{ .Values.orchestration.index.prefix | quote }}
{{- end }}
awsEnabled: {{ or .Values.orchestration.data.secondaryStorage.opensearch.aws.enabled .Values.global.opensearch.aws.enabled }}
history:
elsRolloverDateFormat: {{ .Values.orchestration.history.elsRolloverDateFormat | quote }}
rolloverInterval: {{ .Values.orchestration.history.rolloverInterval | quote }}
rolloverBatchSize: {{ .Values.orchestration.history.rolloverBatchSize }}
waitPeriodBeforeArchiving: {{ .Values.orchestration.history.waitPeriodBeforeArchiving | quote }}
delayBetweenRuns: {{ .Values.orchestration.history.delayBetweenRuns }}
maxDelayBetweenRuns: {{ .Values.orchestration.history.maxDelayBetweenRuns }}
{{- end }}
{{- if eq (include "orchestration.hasAppIntegrations" .) "true" }}
appIntegrations:
args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,17 @@ func TestGoldenConfigmapWithHistoryRetentionEnabled(t *testing.T) {
func (s *ConfigmapLegacyTemplateTest) TestDifferentValuesInputs() {
testCases := []testhelpers.TestCase{
{
Name: "TestContainerShouldContainExporterClassPerDefault",
Name: "TestExportersShouldBeEmptyByDefault",
Values: map[string]string{},
Verifier: func(t *testing.T, output string, err error) {
var configmap corev1.ConfigMap
var configmapApplication camunda.OrchestrationApplicationYAML
helm.UnmarshalK8SYaml(s.T(), output, &configmap)
helm.UnmarshalK8SYaml(s.T(), configmap.Data["application.yaml"], &configmapApplication)

// then
s.Require().Equal("io.camunda.exporter.CamundaExporter", configmapApplication.Zeebe.Broker.Exporters.CamundaExporter.ClassName)
// CamundaExporter is auto-registered via autoconfigure-camunda-exporter: true;
// the legacy zeebe.broker.exporters.camundaexporter entry must not be present.
s.Require().Empty(configmapApplication.Zeebe.Broker.Exporters.CamundaExporter.ClassName)
},
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,6 @@ data:
cluster:
clusterName: camunda-platform-test-zeebe
# zeebe.broker.exporters
exporters:
camundaexporter:
className: "io.camunda.exporter.CamundaExporter"
args:
connect:
type: "elasticsearch"
awsEnabled: false
history:
elsRolloverDateFormat: "date"
rolloverInterval: "1d"
rolloverBatchSize: 100
waitPeriodBeforeArchiving: "1h"
delayBetweenRuns: 2000
maxDelayBetweenRuns: 60000
exporters: {}

log4j2.xml: |
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,7 @@ data:
cluster:
clusterName: camunda-platform-test-zeebe
# zeebe.broker.exporters
exporters:
camundaexporter:
className: "io.camunda.exporter.CamundaExporter"
args:
connect:
type: "elasticsearch"
awsEnabled: false
history:
elsRolloverDateFormat: "date"
rolloverInterval: "1d"
rolloverBatchSize: 100
waitPeriodBeforeArchiving: "1h"
delayBetweenRuns: 2000
maxDelayBetweenRuns: 60000
exporters: {}

log4j2.xml: |
<xml>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,6 @@ data:
cluster:
clusterName: camunda-platform-test-zeebe
# zeebe.broker.exporters
exporters:
camundaexporter:
className: "io.camunda.exporter.CamundaExporter"
args:
connect:
type: "elasticsearch"
awsEnabled: false
history:
elsRolloverDateFormat: "date"
rolloverInterval: "1d"
rolloverBatchSize: 100
waitPeriodBeforeArchiving: "1h"
delayBetweenRuns: 2000
maxDelayBetweenRuns: 60000
exporters: {}

log4j2.xml: |
Loading
Loading