Skip to content

Commit 05eb049

Browse files
authored
Remove unused listeners.config file from the per-broker ConfigMap (#11982)
Signed-off-by: Jakub Scholz <www@scholzj.com>
1 parent c745734 commit 05eb049

3 files changed

Lines changed: 3 additions & 20 deletions

File tree

cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaCluster.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,6 @@ public class KafkaCluster extends AbstractModel implements SupportsMetrics, Supp
200200
*/
201201
public static final String BROKER_CONFIGURATION_FILENAME = "server.config";
202202

203-
/**
204-
* Key under which the listener configuration is stored in Config Map
205-
*/
206-
public static final String BROKER_LISTENERS_FILENAME = "listeners.config";
207-
208203
/**
209204
* Key under which the Kafka cluster.id is stored in Config Map
210205
*/
@@ -1875,14 +1870,6 @@ public List<ConfigMap> generatePerBrokerConfigurationConfigMaps(MetricsAndLoggin
18751870

18761871
data.put(LoggingModel.LOG4J2_CONFIG_MAP_KEY, parsedLogging);
18771872
data.put(BROKER_CONFIGURATION_FILENAME, generatePerBrokerConfiguration(node, pool, advertisedHostnames, advertisedPorts));
1878-
1879-
// List of configured listeners => StrimziPodSets still need this because of OAUTH and how the OAUTH secret
1880-
// environment variables are parsed in the container bash scripts.
1881-
// The actual content of this file is not used on controller-only nodes as they do not expose any
1882-
// user-configured listeners. But we still pass there an empty file as that allows us to share the same
1883-
// script to generate the node configuration.
1884-
data.put(BROKER_LISTENERS_FILENAME, node.broker() ? listeners.stream().map(ListenersUtils::envVarIdentifier).collect(Collectors.joining(" ")) : null);
1885-
18861873
data.put(BROKER_CLUSTER_ID_FILENAME, clusterId);
18871874
data.put(BROKER_METADATA_VERSION_FILENAME, metadataVersion);
18881875

cluster-operator/src/main/java/io/strimzi/operator/cluster/operator/assembly/KafkaReconciler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ protected Future<Void> perBrokerKafkaConfiguration(MetricsAndLogging metricsAndL
672672
.map(kv -> kv.getKey() + "://" + kv.getValue())
673673
.sorted()
674674
.collect(Collectors.joining(" "));
675-
nodeConfiguration += cm.getData().getOrDefault(KafkaCluster.BROKER_LISTENERS_FILENAME, "");
676675
}
677676

678677
// Changes to regular Kafka configuration are handled through the KafkaRoller which decides whether to roll the pod or not

cluster-operator/src/test/java/io/strimzi/operator/cluster/model/KafkaClusterTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,25 +1209,22 @@ public void testPerBrokerConfigMaps() {
12091209
assertThat(cm.getMetadata().getName(), startsWith("foo-"));
12101210

12111211
if (cm.getMetadata().getName().contains("controllers")) {
1212-
assertThat(cm.getData().size(), is(5));
1212+
assertThat(cm.getData().size(), is(4));
12131213
assertThat(cm.getData().get(LoggingModel.LOG4J2_CONFIG_MAP_KEY), is(notNullValue()));
12141214
assertThat(cm.getData().get(KafkaCluster.BROKER_CONFIGURATION_FILENAME), is(notNullValue()));
12151215
assertThat(cm.getData().get(KafkaCluster.BROKER_CONFIGURATION_FILENAME), CoreMatchers.containsString("process.roles=controller\n"));
1216-
assertThat(cm.getData().get(KafkaCluster.BROKER_LISTENERS_FILENAME), is(nullValue()));
12171216
assertThat(cm.getData().get(KafkaCluster.BROKER_CLUSTER_ID_FILENAME), is("dummy-cluster-id"));
12181217
} else if (cm.getMetadata().getName().contains("brokers")) {
1219-
assertThat(cm.getData().size(), is(5));
1218+
assertThat(cm.getData().size(), is(4));
12201219
assertThat(cm.getData().get(LoggingModel.LOG4J2_CONFIG_MAP_KEY), is(notNullValue()));
12211220
assertThat(cm.getData().get(KafkaCluster.BROKER_CONFIGURATION_FILENAME), is(notNullValue()));
12221221
assertThat(cm.getData().get(KafkaCluster.BROKER_CONFIGURATION_FILENAME), CoreMatchers.containsString("process.roles=broker\n"));
1223-
assertThat(cm.getData().get(KafkaCluster.BROKER_LISTENERS_FILENAME), is("PLAIN_9092 TLS_9093"));
12241222
assertThat(cm.getData().get(KafkaCluster.BROKER_CLUSTER_ID_FILENAME), is("dummy-cluster-id"));
12251223
} else {
1226-
assertThat(cm.getData().size(), is(5));
1224+
assertThat(cm.getData().size(), is(4));
12271225
assertThat(cm.getData().get(LoggingModel.LOG4J2_CONFIG_MAP_KEY), is(notNullValue()));
12281226
assertThat(cm.getData().get(KafkaCluster.BROKER_CONFIGURATION_FILENAME), is(notNullValue()));
12291227
assertThat(cm.getData().get(KafkaCluster.BROKER_CONFIGURATION_FILENAME), CoreMatchers.containsString("process.roles=broker,controller\n"));
1230-
assertThat(cm.getData().get(KafkaCluster.BROKER_LISTENERS_FILENAME), is("PLAIN_9092 TLS_9093"));
12311228
assertThat(cm.getData().get(KafkaCluster.BROKER_CLUSTER_ID_FILENAME), is("dummy-cluster-id"));
12321229
}
12331230
}

0 commit comments

Comments
 (0)