From 90db9f75acbc3eb764d66dc90b8fee15394fb704 Mon Sep 17 00:00:00 2001 From: abhishek Date: Thu, 16 Jan 2020 09:23:06 +0530 Subject: [PATCH] kafka scaler fix for sasl plaintext auth --- pkg/scalers/kafka_scaler.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/scalers/kafka_scaler.go b/pkg/scalers/kafka_scaler.go index 83446fc0699..887ce946abb 100644 --- a/pkg/scalers/kafka_scaler.go +++ b/pkg/scalers/kafka_scaler.go @@ -211,6 +211,11 @@ func getKafkaClients(metadata kafkaMetadata) (sarama.Client, sarama.ClusterAdmin config.Net.SASL.Mechanism = sarama.SASLMechanism(sarama.SASLTypeSCRAMSHA512) } + if metadata.authMode == kafkaAuthModeForSaslPlaintext { + config.Net.SASL.Mechanism = sarama.SASLTypePlaintext + config.Net.TLS.Enable = true + } + client, err := sarama.NewClient(metadata.brokers, config) if err != nil { return nil, nil, fmt.Errorf("error creating kafka client: %s", err)