Skip to content

Commit

Permalink
Trim version string
Browse files Browse the repository at this point in the history
  • Loading branch information
lisguo committed Dec 2, 2024
1 parent 00f20d2 commit a3755e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/metric_value_benchmark/jmx_kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package metric_value_benchmark
import (
"fmt"
"log"
"strings"
"time"

"github.com/aws/amazon-cloudwatch-agent-test/test/metric"
Expand Down Expand Up @@ -59,10 +60,10 @@ func (t *JMXKafkaTestRunner) SetupBeforeAgentRun() error {
if err != nil {
return fmt.Errorf("error getting latest kafka version: %v", err)
}
version = strings.TrimSpace(version)

log.Println("set up zookeeper and kafka")
startJMXCommands := []string{
"export KAFKA_VERSION=curl https://dlcdn.apache.org/kafka/ | grep -oE '\\d\\.\\d\\.\\d' | tail -1",
fmt.Sprintf("curl https://dlcdn.apache.org/kafka/%s/kafka_2.13-%s.tgz -o kafka_2.13-latest.tgz", version, version),
"tar -xzf kafka_2.13-latest.tgz",
"echo 'export JMX_PORT=2000'|cat - kafka_2.13-latest/bin/kafka-server-start.sh > /tmp/kafka-server-start.sh && mv /tmp/kafka-server-start.sh kafka_2.13-latest/bin/kafka-server-start.sh",
Expand Down

0 comments on commit a3755e4

Please sign in to comment.