Skip to content

Commit

Permalink
fix(*): added join host port to support ipv6 (#4325)
Browse files Browse the repository at this point in the history
Signed-off-by: Łukasz Dziedziak <lukidzi@gmail.com>
  • Loading branch information
lukidzi authored May 21, 2022
1 parent d143ca3 commit 9c3cd67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions test/e2e_env/kubernetes/metrics/applications_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package metrics

import (
"fmt"
"net"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -116,7 +117,7 @@ func ApplicationsMetrics() {

// when
stdout, _, err := env.Cluster.Exec(namespace, podName, "test-server",
"curl", "-v", "-m", "3", "--fail", "http://"+podIp+":1234/metrics?filter=concurrency")
"curl", "-v", "-m", "3", "--fail", "http://"+net.JoinHostPort(podIp, "1234")+"/metrics?filter=concurrency")

// then
Expect(err).ToNot(HaveOccurred())
Expand All @@ -138,7 +139,7 @@ func ApplicationsMetrics() {

// when
stdout, _, err := env.Cluster.Exec(namespace, podName, "test-server-override-mesh",
"curl", "-v", "-m", "3", "--fail", "http://"+podIp+":1234/metrics?filter=concurrency")
"curl", "-v", "-m", "3", "--fail", "http://"+net.JoinHostPort(podIp, "1234")+"/metrics?filter=concurrency")

// then
Expect(err).ToNot(HaveOccurred())
Expand Down Expand Up @@ -170,7 +171,7 @@ func ApplicationsMetrics() {

// when
stdout, _, err := env.Cluster.Exec(namespace, podName, "test-server-dp-metrics",
"curl", "-v", "-m", "3", "--fail", "http://"+podIp+":1234/metrics?filter=concurrency")
"curl", "-v", "-m", "3", "--fail", "http://"+net.JoinHostPort(podIp, "1234")+"/metrics?filter=concurrency")

// then
Expect(err).ToNot(HaveOccurred())
Expand Down
7 changes: 4 additions & 3 deletions test/e2e_env/universal/metrics/applications_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package metrics

import (
"fmt"
"net"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -123,7 +124,7 @@ metrics:

// when
stdout, _, err := env.Cluster.ExecWithRetries("", "", "test-server",
"curl", "-v", "-m", "3", "--fail", "http://"+ip+":1234/metrics?filter=concurrency")
"curl", "-v", "-m", "3", "--fail", "http://"+net.JoinHostPort(ip, "1234")+"/metrics?filter=concurrency")

// then
Expect(err).ToNot(HaveOccurred())
Expand All @@ -142,7 +143,7 @@ metrics:

// when
stdout, _, err := env.Cluster.ExecWithRetries("", "", "test-server-override-mesh",
"curl", "-v", "-m", "3", "--fail", "http://"+ip+":1234/metrics/overridden?filter=concurrency")
"curl", "-v", "-m", "3", "--fail", "http://"+net.JoinHostPort(ip, "1234")+"/metrics/overridden?filter=concurrency")

// then
Expect(err).ToNot(HaveOccurred())
Expand Down Expand Up @@ -171,7 +172,7 @@ metrics:

// when
stdout, _, err := env.Cluster.ExecWithRetries("", "", "test-server-dp-metrics",
"curl", "-v", "-m", "3", "--fail", "http://"+ip+":5555/stats?filter=concurrency")
"curl", "-v", "-m", "3", "--fail", "http://"+net.JoinHostPort(ip, "5555")+"/stats?filter=concurrency")

// then
Expect(err).ToNot(HaveOccurred())
Expand Down

0 comments on commit 9c3cd67

Please sign in to comment.