Skip to content

Commit da624f6

Browse files
Fix missing Elasticsearch indexing type in Docker ES7 configs
Docker ES7-backed configs enabled indexing and set Elasticsearch version/url, but did not set conductor.indexing.type=elasticsearch. Because the ES7 IndexDAO condition requires that property, the MySQL docker-compose example could fail at startup with a missing IndexDAO bean. This change: - adds conductor.indexing.type=elasticsearch to ES7 docker configs - updates the docs to show the required property - adds a regression test for the ES7 condition
1 parent ccc822a commit da624f6

6 files changed

Lines changed: 90 additions & 0 deletions

File tree

docker/server/config/config-mysql.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ conductor.redis-lock.serverAddress=redis://rs:6379
1515

1616
# Elastic search instance indexing is enabled.
1717
conductor.indexing.enabled=true
18+
conductor.indexing.type=elasticsearch
1819
conductor.elasticsearch.url=http://es:9200
1920
conductor.elasticsearch.indexName=conductor
2021
conductor.elasticsearch.version=7

docker/server/config/config-postgres-es7.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ spring.datasource.password=conductor
1313

1414
# Elastic search instance indexing is enabled.
1515
conductor.indexing.enabled=true
16+
conductor.indexing.type=elasticsearch
1617
conductor.elasticsearch.url=http://es:9200
1718
conductor.elasticsearch.indexName=conductor
1819
conductor.elasticsearch.version=7

docker/server/config/config-redis.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ conductor.app.systemTaskMaxPollCount=20
1818

1919
# Elastic search instance indexing is enabled.
2020
conductor.indexing.enabled=true
21+
conductor.indexing.type=elasticsearch
2122
conductor.elasticsearch.url=http://es:9200
2223
conductor.elasticsearch.indexName=conductor
2324
conductor.elasticsearch.version=7

docker/server/config/config.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
# When using Elasticsearch 7 for indexing, set the following
3737

3838
# conductor.indexing.enabled=true
39+
# conductor.indexing.type=elasticsearch
3940
# conductor.elasticsearch.url=http://es:9200
4041
# conductor.elasticsearch.version=7
4142
# conductor.elasticsearch.indexName=conductor

docs/devguide/running/deploy.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ conductor.elasticsearch.version=0
206206

207207
```properties
208208
conductor.indexing.enabled=true
209+
conductor.indexing.type=elasticsearch
209210
conductor.elasticsearch.url=http://es-host:9200
210211
conductor.elasticsearch.version=7
211212
conductor.elasticsearch.indexName=conductor
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright 2026 Conductor Authors.
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
* <p>
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
* <p>
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
package com.netflix.conductor.es7.config;
14+
15+
import org.junit.Test;
16+
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
17+
import org.springframework.context.annotation.Bean;
18+
import org.springframework.context.annotation.Conditional;
19+
import org.springframework.context.annotation.Configuration;
20+
21+
import static org.junit.Assert.assertFalse;
22+
import static org.junit.Assert.assertTrue;
23+
24+
public class ElasticSearchConditionsTest {
25+
26+
private final ApplicationContextRunner contextRunner =
27+
new ApplicationContextRunner()
28+
.withUserConfiguration(ConditionalTestConfiguration.class);
29+
30+
@Test
31+
public void shouldActivateForElasticsearchV7Selector() {
32+
contextRunner
33+
.withPropertyValues(
34+
"conductor.indexing.enabled=true",
35+
"conductor.indexing.type=elasticsearch",
36+
"conductor.elasticsearch.version=7")
37+
.run(context -> assertTrue(context.containsBean("es7Marker")));
38+
}
39+
40+
@Test
41+
public void shouldActivateWhenVersionIsImplicit() {
42+
contextRunner
43+
.withPropertyValues(
44+
"conductor.indexing.enabled=true", "conductor.indexing.type=elasticsearch")
45+
.run(context -> assertTrue(context.containsBean("es7Marker")));
46+
}
47+
48+
@Test
49+
public void shouldNotActivateWhenIndexingIsDisabled() {
50+
contextRunner
51+
.withPropertyValues(
52+
"conductor.indexing.enabled=false",
53+
"conductor.indexing.type=elasticsearch",
54+
"conductor.elasticsearch.version=7")
55+
.run(context -> assertFalse(context.containsBean("es7Marker")));
56+
}
57+
58+
@Test
59+
public void shouldNotActivateForLegacyVersionPropertyOnly() {
60+
contextRunner
61+
.withPropertyValues(
62+
"conductor.indexing.enabled=true", "conductor.elasticsearch.version=7")
63+
.run(context -> assertFalse(context.containsBean("es7Marker")));
64+
}
65+
66+
@Test
67+
public void shouldNotActivateForElasticsearch8Selector() {
68+
contextRunner
69+
.withPropertyValues(
70+
"conductor.indexing.enabled=true", "conductor.indexing.type=elasticsearch8")
71+
.run(context -> assertFalse(context.containsBean("es7Marker")));
72+
}
73+
74+
@Configuration(proxyBeanMethods = false)
75+
@Conditional(ElasticSearchConditions.ElasticSearchV7Enabled.class)
76+
static class ConditionalTestConfiguration {
77+
78+
@Bean
79+
Marker es7Marker() {
80+
return new Marker();
81+
}
82+
}
83+
84+
static class Marker {}
85+
}

0 commit comments

Comments
 (0)