Skip to content

Commit

Permalink
Merge pull request #15855 from geoand/kafka-binding-fixes
Browse files Browse the repository at this point in the history
Fix kafka binding issues
  • Loading branch information
geoand authored Mar 18, 2021
2 parents e355848 + 897142f commit 7096c33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public Optional<ServiceBindingConfigSource> convert(List<ServiceBinding> service
Map<String, String> properties = new HashMap<>();
ServiceBinding binding = matchingByType.get();

String bootstrapServers = binding.getProperties().get("bootstrapServers");
String bootstrapServers = binding.getProperties().get("bootstrapservers");
if (bootstrapServers == null) {
bootstrapServers = binding.getProperties().get("bootstrap-servers");
}
Expand All @@ -42,7 +42,9 @@ public Optional<ServiceBindingConfigSource> convert(List<ServiceBinding> service
String password = binding.getProperties().get("password");
if ("PLAIN".equals(saslMechanism) && (user != null) && (password != null)) {
properties.put("kafka.sasl.jaas.config",
String.format("org.apache.kafka.common.security.plain.PlainLoginModule required %s %s", user, password));
String.format(
"org.apache.kafka.common.security.plain.PlainLoginModule required username='%s' password='%s';",
user, password));
}

return Optional.of(new ServiceBindingConfigSource("kafka-k8s-service-binding-source", properties));
Expand Down

0 comments on commit 7096c33

Please sign in to comment.