Skip to content

Commit

Permalink
Use bootstrap server
Browse files Browse the repository at this point in the history
Signed-off-by: tuannvm <[email protected]>
  • Loading branch information
tuannvm committed Feb 20, 2022
1 parent 027cad6 commit 081b8f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/kafka/kafka-liveness-stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func LivenessStream(experimentsDetails *experimentTypes.ExperimentDetails, clien
if experimentsDetails.KafkaInstanceName == "" {

execCommandDetails := litmusexec.PodDetails{}
command := append([]string{"/bin/sh", "-c"}, "kafka-topics --topic topic-"+experimentsDetails.RunID+" --describe --zookeeper "+experimentsDetails.ZookeeperService+":"+experimentsDetails.ZookeeperPort+" | grep -o 'Leader: [^[:space:]]*' | awk '{print $2}'")
command := append([]string{"/bin/sh", "-c"}, "kafka-topics --topic topic-"+experimentsDetails.RunID+" --describe --boostrap-server "+experimentsDetails.KafkaService+":"+experimentsDetails.KafkaPort+" | grep -o 'Leader: [^[:space:]]*' | awk '{print $2}'")
litmusexec.SetExecCommandAttributes(&execCommandDetails, "kafka-liveness-"+experimentsDetails.RunID, "kafka-consumer", experimentsDetails.KafkaNamespace)
ordinality, err = litmusexec.Exec(&execCommandDetails, clients, command)
if err != nil {
Expand All @@ -50,7 +50,7 @@ func LivenessStream(experimentsDetails *experimentTypes.ExperimentDetails, clien
// It will contains all the pod & container details required for exec command
execCommandDetails := litmusexec.PodDetails{}

command := append([]string{"/bin/sh", "-c"}, "kafka-topics --topic topic-"+experimentsDetails.RunID+" --describe --zookeeper "+experimentsDetails.ZookeeperService+":"+experimentsDetails.ZookeeperPort+"/"+experimentsDetails.KafkaInstanceName+" | grep -o 'Leader: [^[:space:]]*' | awk '{print $2}'")
command := append([]string{"/bin/sh", "-c"}, "kafka-topics --topic topic-"+experimentsDetails.RunID+" --describe --bootstrap-server "+experimentsDetails.KafkaService+":"+experimentsDetails.KafkaPort+"/"+experimentsDetails.KafkaInstanceName+" | grep -o 'Leader: [^[:space:]]*' | awk '{print $2}'")
litmusexec.SetExecCommandAttributes(&execCommandDetails, "kafka-liveness-"+experimentsDetails.RunID, "kafka-consumer", experimentsDetails.KafkaNamespace)
ordinality, err = litmusexec.Exec(&execCommandDetails, clients, command)
if err != nil {
Expand Down Expand Up @@ -109,12 +109,12 @@ func CreateLivenessPod(experimentsDetails *experimentTypes.ExperimentDetails, Ka
Value: experimentsDetails.KafkaInstanceName,
},
{
Name: "ZOOKEEPER_SERVICE",
Value: experimentsDetails.ZookeeperService,
Name: "KAFKA_SERVICE",
Value: experimentsDetails.KafkaService,
},
{
Name: "ZOOKEEPER_PORT",
Value: experimentsDetails.ZookeeperPort,
Name: "KAFKA_PORT",
Value: experimentsDetails.KafkaPort,
},
{
Name: "REPLICATION_FACTOR",
Expand Down

0 comments on commit 081b8f1

Please sign in to comment.