Skip to content

Commit c604c5b

Browse files
committed
Fix unit tests that failed due to rebasing the main branch
Signed-off-by: Gantigmaa Selenge <[email protected]>
1 parent 18e1038 commit c604c5b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,7 @@ private List<VolumeMount> getVolumeMounts(Storage storage, ContainerTemplate con
14611461
volumeMountList.add(VolumeUtils.createVolumeMount(INIT_VOLUME_NAME, INIT_VOLUME_MOUNT));
14621462
}
14631463

1464+
boolean oauthVolumeMountAdded = false;
14641465
// Listener specific volumes related to their specific authentication or encryption settings
14651466
for (GenericKafkaListener listener : listeners) {
14661467
String identifier = ListenersUtils.identifier(listener);
@@ -1471,9 +1472,11 @@ private List<VolumeMount> getVolumeMounts(Storage storage, ContainerTemplate con
14711472
volumeMountList.add(VolumeUtils.createVolumeMount("custom-" + identifier + "-certs", "/opt/kafka/certificates/custom-" + identifier + "-certs"));
14721473
}
14731474

1474-
if (ListenersUtils.isListenerWithOAuth(listener) && listener.getAuth() instanceof KafkaListenerAuthenticationOAuth oauth && oauth.getTlsTrustedCertificates() != null) {
1475+
if (!oauthVolumeMountAdded && ListenersUtils.isListenerWithOAuth(listener) && listener.getAuth() instanceof KafkaListenerAuthenticationOAuth oauth && oauth.getTlsTrustedCertificates() != null) {
14751476
String oauthTrustedCertsSecret = KafkaResources.internalOauthTrustedCertsSecretName(cluster);
14761477
volumeMountList.add(VolumeUtils.createVolumeMount(oauthTrustedCertsSecret, TRUSTED_CERTS_BASE_VOLUME_MOUNT + "/" + oauthTrustedCertsSecret));
1478+
// the internal oauth trusted secret does not need to be volume mounted for each listener, as it contains all the trusted certificates
1479+
oauthVolumeMountAdded = true;
14771480
}
14781481

14791482
if (ListenersUtils.isListenerWithCustomAuth(listener)) {

0 commit comments

Comments
 (0)