Skip to content

Commit

Permalink
Fix IPv6 compatibility issue with starter pod
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang Zhao authored and zzhao2010 committed Aug 31, 2024
1 parent f75facb commit c83718a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/resources/containers/curl_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package containers
import (
"encoding/json"
"fmt"
"net"
"strings"

"github.com/grafana/k6-operator/pkg/types"
Expand All @@ -26,7 +27,7 @@ func NewStartContainer(hostnames []string, image string, imagePullPolicy corev1.

var parts []string
for _, hostname := range hostnames {
parts = append(parts, fmt.Sprintf("curl --retry 3 -X PATCH -H 'Content-Type: application/json' http://%s:6565/v1/status -d '%s'", hostname, req))
parts = append(parts, fmt.Sprintf("curl --retry 3 -X PATCH -H 'Content-Type: application/json' http://%s/v1/status -d '%s'", net.JoinHostPort(hostname, "6565"), req))
}

return corev1.Container{
Expand Down
3 changes: 2 additions & 1 deletion pkg/resources/containers/curl_stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package containers
import (
"encoding/json"
"fmt"
"net"
"strings"

"github.com/grafana/k6-operator/pkg/types"
Expand All @@ -26,7 +27,7 @@ func NewStopContainer(hostnames []string, image string, imagePullPolicy corev1.P

var parts []string
for _, hostname := range hostnames {
parts = append(parts, fmt.Sprintf("curl --retry 3 -X PATCH -H 'Content-Type: application/json' http://%s:6565/v1/status -d '%s'", hostname, req))
parts = append(parts, fmt.Sprintf("curl --retry 3 -X PATCH -H 'Content-Type: application/json' http://%s/v1/status -d '%s'", net.JoinHostPort(hostname, "6565"), req))
}

return corev1.Container{
Expand Down

0 comments on commit c83718a

Please sign in to comment.