Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app-policy/cmd/dikastes/dikastes.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (h *httpTerminationHandler) RunHTTPServer(addr string, port string) (*http.
}
}

httpServerSockAddr := fmt.Sprintf("%s:%s", addr, port)
httpServerSockAddr := net.JoinHostPort(addr, port)
httpServerMux := http.NewServeMux()
httpServerMux.Handle("/terminate", h)
httpServer := &http.Server{Addr: httpServerSockAddr, Handler: httpServerMux}
Expand Down
3 changes: 2 additions & 1 deletion felix/fv/infrastructure/felix.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"
"io"
"maps"
"net"
"net/http"
"os"
"path"
Expand Down Expand Up @@ -420,7 +421,7 @@ func (f *Felix) Ready() (bool, error) {
healthAddr = f.TopologyOptions.ExtraEnvVars["FELIX_HEALTHHOST"]
}

url := "http://" + healthAddr + ":9099/readiness"
url := "http://" + net.JoinHostPort(healthAddr, "9099") + "/readiness"
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
Comment on lines 423 to 425
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description says IPv6 BPF FV tests broke due to unbracketed IPv6 in URLs and that this PR replaces string concatenation with JoinHostPort(), but there are still unbracketed host:port URL constructions elsewhere (e.g., felix/fv/health_test.go:429 uses "http://"+felix.IP+":9099/..." and felix/k8sfv/metric.go:28 uses "http://"+felixIP+":9091/...", plus felix/fv/utils/utils.go:203 for etcd endpoints). Either expand this PR to cover these remaining cases or narrow the description/scope accordingly; otherwise IPv6 test coverage may still fail under the stricter net/url parsing.

Copilot uses AI. Check for mistakes.
defer cancel()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
Expand Down
2 changes: 1 addition & 1 deletion felix/fv/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func GetRawMetrics(ip string, port int, caFile, certFile, keyFile string) (out s
httpClient.Transport = &http.Transport{}
}
var resp *http.Response
resp, err = httpClient.Get(fmt.Sprintf("%v://%v:%v/metrics", method, ip, port))
resp, err = httpClient.Get(fmt.Sprintf("%s://%s/metrics", method, net.JoinHostPort(ip, strconv.Itoa(port))))
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion guardian/pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (srv *server) ListenAndServeCluster() error {
return fmt.Errorf("failed to connect to tunnel: %w", err)
}

listener, err := net.Listen("tcp", fmt.Sprintf("%s:%s", srv.listenHost, srv.listenPort))
listener, err := net.Listen("tcp", net.JoinHostPort(srv.listenHost, srv.listenPort))
if err != nil {
return fmt.Errorf("failed to listen on %s:%s: %w", srv.listenHost, srv.listenPort, err)
}
Expand Down
5 changes: 3 additions & 2 deletions node/pkg/health/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"context"
"errors"
"fmt"
"net"
"net/http"
"os"
"os/exec"
Expand Down Expand Up @@ -50,8 +51,8 @@ func init() {
felixHost = "localhost"
}

felixReadinessEp = "http://" + felixHost + ":" + felixPort + "/readiness"
felixLivenessEp = "http://" + felixHost + ":" + felixPort + "/liveness"
felixReadinessEp = "http://" + net.JoinHostPort(felixHost, felixPort) + "/readiness"
felixLivenessEp = "http://" + net.JoinHostPort(felixHost, felixPort) + "/liveness"
}

func Run(bird, bird6, felixReady, felixLive, birdLive, bird6Live bool, thresholdTime time.Duration) {
Expand Down
4 changes: 2 additions & 2 deletions whisker-backend/pkg/config/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package config

import (
"encoding/json"
"fmt"
"net"
"os"

"github.com/kelseyhightower/envconfig"
Expand Down Expand Up @@ -56,7 +56,7 @@ func (cfg *Config) String() string {
}

func (cfg *Config) HostAddr() string {
return fmt.Sprintf("%s:%s", cfg.Host, cfg.Port)
return net.JoinHostPort(cfg.Host, cfg.Port)
}
Comment on lines 58 to 60
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR body still contains a release-note block with "TBD". The repo's release-note validation workflow fails when release notes are required and the block is left as "TBD", so this may need to be updated to a one-line user-visible note (or set to "None" if appropriate).

Copilot uses AI. Check for mistakes.

func (cfg *Config) ConfigureLogging() {
Expand Down
Loading