Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public Map<String, String> desired(final KafkaAccessSpec spec, final String name
try {
listener = KafkaParser.getKafkaListener(kafka, spec, kafkaUserType);
} catch (CustomResourceParseException e) {
LOGGER.error("Reconcile failed due to ParserException " + e.getMessage());
LOGGER.error("Reconcile failed due to ParserException {}", e.getMessage(), e);
throw e;
}
if (listener.isTls()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import java.util.stream.Stream;

/**
* Maps Strimzi and Kuberentes resources to and from KafkaAccess resources
* Maps Strimzi and Kubernetes resources to and from KafkaAccess resources
*/
public class KafkaAccessMapper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,12 @@ public Map<String, String> getConnectionSecretData() {
}

private SecurityProtocol getSecurityProtocol() {
final SecurityProtocol securityProtocol;
switch (this.authenticationType) {
case LISTENER_AUTH_NONE:
securityProtocol = this.tls ? SecurityProtocol.SSL : SecurityProtocol.PLAINTEXT;
break;
case KafkaListenerAuthenticationTls.TYPE_TLS:
securityProtocol = SecurityProtocol.SSL;
break;
case KafkaListenerAuthenticationScramSha512.SCRAM_SHA_512:
securityProtocol = this.tls ? SecurityProtocol.SASL_SSL : SecurityProtocol.SASL_PLAINTEXT;
break;
default:
securityProtocol = SecurityProtocol.PLAINTEXT;
}
return securityProtocol;
return switch (this.authenticationType) {
case LISTENER_AUTH_NONE -> this.tls ? SecurityProtocol.SSL : SecurityProtocol.PLAINTEXT;
case KafkaListenerAuthenticationTls.TYPE_TLS -> SecurityProtocol.SSL;
case KafkaListenerAuthenticationScramSha512.SCRAM_SHA_512 ->
this.tls ? SecurityProtocol.SASL_SSL : SecurityProtocol.SASL_PLAINTEXT;
default -> SecurityProtocol.PLAINTEXT;
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package io.strimzi.kafka.access.internal;

/**
* The class for exception when Kuberentes resources are missing
* The class for exception when Kubernetes resources are missing
*/
public class MissingKubernetesResourceException extends RuntimeException {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public class KafkaAccessReconcilerTest {
@BeforeEach
void beforeEach() {
operator = new Operator(overrider -> overrider.withKubernetesClient(client)
/**
/*
* Disables the use of Server-Side Apply for patching the primary resource.
* Motivation: Mock Kubernetes client doesn't fully support SSA features.
* See: <a href="https://github.com/fabric8io/kubernetes-client/issues/5337">fabric8io/kubernetes-client Issue #5337</a>
**/
*/
.withUseSSAToPatchPrimaryResource(false));
operator.register(new KafkaAccessReconciler(operator.getKubernetesClient()));
operator.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private Path checkPathAndReturnFullRootPathWithIndexFolder(Path rootPathToLogsFo
// check if there is actually something in the list of folders
if (!indexes.isEmpty()) {
// take the highest index and increase it by one for a new directory
index = Integer.parseInt(indexes.get(indexes.size() - 1)) + 1;
index = Integer.parseInt(indexes.getLast()) + 1;
}
}
}
Expand Down
Loading