Skip to content

Commit 8a96247

Browse files
fix: guard legacy ES exporter on global.elasticsearch.enabled (#6244)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a47a4f1 commit 8a96247

4 files changed

Lines changed: 208 additions & 4 deletions

File tree

charts/camunda-platform-8.10/templates/orchestration/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ and
289289

290290
{{- define "orchestration.hasLegacyElasticsearchExporter" -}}
291291
{{- and
292-
(or
293-
(and .Values.orchestration.exporters.rdbms.enabled .Values.optimize.enabled)
292+
(or
293+
(and .Values.global.elasticsearch.enabled .Values.orchestration.exporters.rdbms.enabled .Values.optimize.enabled)
294294
(or
295295
(and .Values.global.elasticsearch.enabled .Values.orchestration.exporters.zeebe.enabled)
296296
(and (or .Values.global.elasticsearch.enabled .Values.optimize.database.elasticsearch.enabled) .Values.optimize.enabled)

charts/camunda-platform-8.10/test/unit/orchestration/configmap_unified_test.go

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,106 @@ func (s *ConfigmapTemplateTest) TestDifferentValuesInputsUnifiedRDBMS() {
494494
testhelpers.RunTestCases(s.T(), s.chartPath, s.release, s.namespace, s.templates, testCases)
495495
}
496496

497+
func (s *ConfigmapTemplateTest) TestHasLegacyElasticsearchExporter() {
498+
testCases := []testhelpers.TestCase{
499+
{
500+
Name: "TestLegacyESExporterAbsentWhenRdbmsAndOptimizeButNoElasticsearch",
501+
Values: map[string]string{
502+
"global.elasticsearch.enabled": "false",
503+
"global.opensearch.enabled": "true",
504+
"global.opensearch.url.host": "opensearch.example.com",
505+
"orchestration.exporters.rdbms.enabled": "true",
506+
"orchestration.data.secondaryStorage.rdbms.url": "jdbc:postgresql://localhost:5432/camunda",
507+
"orchestration.data.secondaryStorage.rdbms.username": "camunda",
508+
"orchestration.data.secondaryStorage.rdbms.secret.inlineSecret": "my-password",
509+
"optimize.enabled": "true",
510+
"optimize.database.opensearch.enabled": "true",
511+
},
512+
Verifier: func(t *testing.T, output string, err error) {
513+
require.NoError(t, err)
514+
require.NotContains(t, output, "io.camunda.zeebe.exporter.ElasticsearchExporter",
515+
"rdbms+optimize without elasticsearch must not render legacy ES exporter")
516+
},
517+
},
518+
{
519+
Name: "TestLegacyESExporterPresentWhenRdbmsAndOptimizeAndGlobalElasticsearch",
520+
Values: map[string]string{
521+
"orchestration.exporters.rdbms.enabled": "true",
522+
"orchestration.data.secondaryStorage.rdbms.url": "jdbc:postgresql://localhost:5432/camunda",
523+
"orchestration.data.secondaryStorage.rdbms.username": "camunda",
524+
"orchestration.data.secondaryStorage.rdbms.secret.inlineSecret": "my-password",
525+
"optimize.enabled": "true",
526+
},
527+
Verifier: func(t *testing.T, output string, err error) {
528+
require.NoError(t, err)
529+
require.Contains(t, output, "io.camunda.zeebe.exporter.ElasticsearchExporter",
530+
"rdbms+optimize with global.elasticsearch.enabled must render legacy ES exporter")
531+
},
532+
},
533+
{
534+
Name: "TestLegacyESExporterPresentWhenRdbmsAndOptimizeDatabaseElasticsearchOnly",
535+
Values: map[string]string{
536+
"global.elasticsearch.enabled": "false",
537+
"global.opensearch.enabled": "true",
538+
"global.opensearch.url.host": "opensearch.example.com",
539+
"orchestration.exporters.rdbms.enabled": "true",
540+
"orchestration.data.secondaryStorage.rdbms.url": "jdbc:postgresql://localhost:5432/camunda",
541+
"orchestration.data.secondaryStorage.rdbms.username": "camunda",
542+
"orchestration.data.secondaryStorage.rdbms.secret.inlineSecret": "my-password",
543+
"optimize.enabled": "true",
544+
"optimize.database.elasticsearch.enabled": "true",
545+
"optimize.database.elasticsearch.external": "true",
546+
},
547+
Verifier: func(t *testing.T, output string, err error) {
548+
require.NoError(t, err)
549+
require.Contains(t, output, "io.camunda.zeebe.exporter.ElasticsearchExporter",
550+
"rdbms+optimize with optimize.database.elasticsearch.enabled must render legacy ES exporter")
551+
},
552+
},
553+
{
554+
Name: "TestLegacyESExporterAbsentForSupport32901CustomerConfig",
555+
Values: map[string]string{
556+
"global.elasticsearch.enabled": "false",
557+
"global.opensearch.enabled": "true",
558+
"global.opensearch.url.host": "opensearch.example.com",
559+
"orchestration.exporters.rdbms.enabled": "true",
560+
"orchestration.exporters.zeebe.enabled": "true",
561+
"orchestration.data.secondaryStorage.rdbms.url": "jdbc:postgresql://localhost:5432/camunda",
562+
"orchestration.data.secondaryStorage.rdbms.username": "camunda",
563+
"orchestration.data.secondaryStorage.rdbms.secret.inlineSecret": "my-password",
564+
"optimize.enabled": "true",
565+
"optimize.database.opensearch.enabled": "true",
566+
},
567+
Verifier: func(t *testing.T, output string, err error) {
568+
require.NoError(t, err)
569+
require.NotContains(t, output, "io.camunda.zeebe.exporter.ElasticsearchExporter",
570+
"SUPPORT-32901: rdbms+optimize+zeebe with OpenSearch must not render legacy ES exporter")
571+
require.Contains(t, output, "io.camunda.zeebe.exporter.opensearch.OpensearchExporter",
572+
"SUPPORT-32901: OS exporter must still render to feed Optimize")
573+
},
574+
},
575+
{
576+
Name: "TestLegacyESExporterAbsentWhenOnlyRdbmsNoOptimize",
577+
Values: map[string]string{
578+
"global.elasticsearch.enabled": "false",
579+
"global.opensearch.enabled": "true",
580+
"global.opensearch.url.host": "opensearch.example.com",
581+
"orchestration.exporters.rdbms.enabled": "true",
582+
"orchestration.data.secondaryStorage.rdbms.url": "jdbc:postgresql://localhost:5432/camunda",
583+
"orchestration.data.secondaryStorage.rdbms.username": "camunda",
584+
"orchestration.data.secondaryStorage.rdbms.secret.inlineSecret": "my-password",
585+
},
586+
Verifier: func(t *testing.T, output string, err error) {
587+
require.NoError(t, err)
588+
require.NotContains(t, output, "io.camunda.zeebe.exporter.ElasticsearchExporter",
589+
"rdbms without optimize must not render legacy ES exporter")
590+
},
591+
},
592+
}
593+
594+
testhelpers.RunTestCasesE(s.T(), s.chartPath, s.release, s.namespace, s.templates, testCases)
595+
}
596+
497597
func (s *ConfigmapTemplateTest) TestMultiRegionInitialContactPoints() {
498598
testCases := []testhelpers.TestCase{
499599
{

charts/camunda-platform-8.9/templates/orchestration/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ and
289289

290290
{{- define "orchestration.hasLegacyElasticsearchExporter" -}}
291291
{{- and
292-
(or
293-
(and .Values.orchestration.exporters.rdbms.enabled .Values.optimize.enabled)
292+
(or
293+
(and .Values.global.elasticsearch.enabled .Values.orchestration.exporters.rdbms.enabled .Values.optimize.enabled)
294294
(or
295295
(and .Values.global.elasticsearch.enabled .Values.orchestration.exporters.zeebe.enabled)
296296
(and (or .Values.global.elasticsearch.enabled .Values.optimize.database.elasticsearch.enabled) .Values.optimize.enabled)

charts/camunda-platform-8.9/test/unit/orchestration/configmap_unified_test.go

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,110 @@ func (s *ConfigmapTemplateTest) TestDifferentValuesInputsUnifiedRDBMS() {
513513
testhelpers.RunTestCases(s.T(), s.chartPath, s.release, s.namespace, s.templates, testCases)
514514
}
515515

516+
func (s *ConfigmapTemplateTest) TestHasLegacyElasticsearchExporter() {
517+
testCases := []testhelpers.TestCase{
518+
{
519+
Name: "TestLegacyESExporterAbsentWhenRdbmsAndOptimizeButNoElasticsearch",
520+
Values: map[string]string{
521+
"global.elasticsearch.enabled": "false",
522+
"elasticsearch.enabled": "false",
523+
"global.opensearch.enabled": "true",
524+
"global.opensearch.url.host": "opensearch.example.com",
525+
"orchestration.exporters.rdbms.enabled": "true",
526+
"orchestration.data.secondaryStorage.rdbms.url": "jdbc:postgresql://localhost:5432/camunda",
527+
"orchestration.data.secondaryStorage.rdbms.username": "camunda",
528+
"orchestration.data.secondaryStorage.rdbms.secret.inlineSecret": "my-password",
529+
"optimize.enabled": "true",
530+
"optimize.database.opensearch.enabled": "true",
531+
},
532+
Verifier: func(t *testing.T, output string, err error) {
533+
require.NoError(t, err)
534+
require.NotContains(t, output, "io.camunda.zeebe.exporter.ElasticsearchExporter",
535+
"rdbms+optimize without elasticsearch must not render legacy ES exporter")
536+
},
537+
},
538+
{
539+
Name: "TestLegacyESExporterPresentWhenRdbmsAndOptimizeAndGlobalElasticsearch",
540+
Values: map[string]string{
541+
"orchestration.exporters.rdbms.enabled": "true",
542+
"orchestration.data.secondaryStorage.rdbms.url": "jdbc:postgresql://localhost:5432/camunda",
543+
"orchestration.data.secondaryStorage.rdbms.username": "camunda",
544+
"orchestration.data.secondaryStorage.rdbms.secret.inlineSecret": "my-password",
545+
"optimize.enabled": "true",
546+
},
547+
Verifier: func(t *testing.T, output string, err error) {
548+
require.NoError(t, err)
549+
require.Contains(t, output, "io.camunda.zeebe.exporter.ElasticsearchExporter",
550+
"rdbms+optimize with global.elasticsearch.enabled must render legacy ES exporter")
551+
},
552+
},
553+
{
554+
Name: "TestLegacyESExporterPresentWhenRdbmsAndOptimizeDatabaseElasticsearchOnly",
555+
Values: map[string]string{
556+
"global.elasticsearch.enabled": "false",
557+
"elasticsearch.enabled": "false",
558+
"global.opensearch.enabled": "true",
559+
"global.opensearch.url.host": "opensearch.example.com",
560+
"orchestration.exporters.rdbms.enabled": "true",
561+
"orchestration.data.secondaryStorage.rdbms.url": "jdbc:postgresql://localhost:5432/camunda",
562+
"orchestration.data.secondaryStorage.rdbms.username": "camunda",
563+
"orchestration.data.secondaryStorage.rdbms.secret.inlineSecret": "my-password",
564+
"optimize.enabled": "true",
565+
"optimize.database.elasticsearch.enabled": "true",
566+
"optimize.database.elasticsearch.external": "true",
567+
},
568+
Verifier: func(t *testing.T, output string, err error) {
569+
require.NoError(t, err)
570+
require.Contains(t, output, "io.camunda.zeebe.exporter.ElasticsearchExporter",
571+
"rdbms+optimize with optimize.database.elasticsearch.enabled must render legacy ES exporter")
572+
},
573+
},
574+
{
575+
Name: "TestLegacyESExporterAbsentForSupport32901CustomerConfig",
576+
Values: map[string]string{
577+
"global.elasticsearch.enabled": "false",
578+
"elasticsearch.enabled": "false",
579+
"global.opensearch.enabled": "true",
580+
"global.opensearch.url.host": "opensearch.example.com",
581+
"orchestration.exporters.rdbms.enabled": "true",
582+
"orchestration.exporters.zeebe.enabled": "true",
583+
"orchestration.data.secondaryStorage.rdbms.url": "jdbc:postgresql://localhost:5432/camunda",
584+
"orchestration.data.secondaryStorage.rdbms.username": "camunda",
585+
"orchestration.data.secondaryStorage.rdbms.secret.inlineSecret": "my-password",
586+
"optimize.enabled": "true",
587+
"optimize.database.opensearch.enabled": "true",
588+
},
589+
Verifier: func(t *testing.T, output string, err error) {
590+
require.NoError(t, err)
591+
require.NotContains(t, output, "io.camunda.zeebe.exporter.ElasticsearchExporter",
592+
"SUPPORT-32901: rdbms+optimize+zeebe with OpenSearch must not render legacy ES exporter")
593+
require.Contains(t, output, "io.camunda.zeebe.exporter.opensearch.OpensearchExporter",
594+
"SUPPORT-32901: OS exporter must still render to feed Optimize")
595+
},
596+
},
597+
{
598+
Name: "TestLegacyESExporterAbsentWhenOnlyRdbmsNoOptimize",
599+
Values: map[string]string{
600+
"global.elasticsearch.enabled": "false",
601+
"elasticsearch.enabled": "false",
602+
"global.opensearch.enabled": "true",
603+
"global.opensearch.url.host": "opensearch.example.com",
604+
"orchestration.exporters.rdbms.enabled": "true",
605+
"orchestration.data.secondaryStorage.rdbms.url": "jdbc:postgresql://localhost:5432/camunda",
606+
"orchestration.data.secondaryStorage.rdbms.username": "camunda",
607+
"orchestration.data.secondaryStorage.rdbms.secret.inlineSecret": "my-password",
608+
},
609+
Verifier: func(t *testing.T, output string, err error) {
610+
require.NoError(t, err)
611+
require.NotContains(t, output, "io.camunda.zeebe.exporter.ElasticsearchExporter",
612+
"rdbms without optimize must not render legacy ES exporter")
613+
},
614+
},
615+
}
616+
617+
testhelpers.RunTestCasesE(s.T(), s.chartPath, s.release, s.namespace, s.templates, testCases)
618+
}
619+
516620
func (s *ConfigmapTemplateTest) TestMultiRegionInitialContactPoints() {
517621
testCases := []testhelpers.TestCase{
518622
{

0 commit comments

Comments
 (0)