diff --git a/internal/configs/transportserver.go b/internal/configs/transportserver.go index ca1009e280..1bcf43cb67 100644 --- a/internal/configs/transportserver.go +++ b/internal/configs/transportserver.go @@ -154,7 +154,7 @@ func generateTransportServerHealthCheck(upstreamName string, generatedUpstreamNa } if u.HealthCheck.Port > 0 { - hc.Port = u.HealthCheck.Port + hc.Port = &u.HealthCheck.Port } if u.HealthCheck.Match != nil { @@ -175,7 +175,6 @@ func generateTransportServerHealthCheckWithDefaults(up conf_v1alpha1.Upstream) * Enabled: false, Timeout: "5s", Jitter: "0s", - Port: up.Port, Interval: "5s", Passes: 1, Fails: 1, diff --git a/internal/configs/transportserver_test.go b/internal/configs/transportserver_test.go index 95a9a6ad7e..baeedb1b7a 100644 --- a/internal/configs/transportserver_test.go +++ b/internal/configs/transportserver_test.go @@ -581,7 +581,7 @@ func TestGenerateTransportServerHealthChecks(t *testing.T) { Enabled: true, Timeout: "40s", Jitter: "30s", - Port: 88, + Port: intPointer(88), Interval: "20s", Passes: 4, Fails: 5, @@ -620,7 +620,7 @@ func TestGenerateTransportServerHealthChecks(t *testing.T) { Enabled: true, Timeout: "40s", Jitter: "30s", - Port: 88, + Port: intPointer(88), Interval: "20s", Passes: 4, Fails: 5, @@ -642,7 +642,6 @@ func TestGenerateTransportServerHealthChecks(t *testing.T) { Enabled: true, Timeout: "5s", Jitter: "0s", - Port: 90, Interval: "5s", Passes: 1, Fails: 1, @@ -668,7 +667,6 @@ func TestGenerateTransportServerHealthChecks(t *testing.T) { Enabled: true, Timeout: "5s", Jitter: "0s", - Port: 90, Interval: "5s", Passes: 1, Fails: 1, diff --git a/internal/configs/version2/stream.go b/internal/configs/version2/stream.go index 3ef93c5f8c..4877afcd07 100644 --- a/internal/configs/version2/stream.go +++ b/internal/configs/version2/stream.go @@ -49,7 +49,7 @@ type StreamServer struct { type StreamHealthCheck struct { Enabled bool Interval string - Port int + Port *int Passes int Jitter string Fails int diff --git a/internal/configs/version2/templates_test.go b/internal/configs/version2/templates_test.go index 23e90c78f8..e4284cdc4f 100644 --- a/internal/configs/version2/templates_test.go +++ b/internal/configs/version2/templates_test.go @@ -389,7 +389,7 @@ var transportServerCfg = TransportServerConfig{ Enabled: false, Timeout: "5s", Jitter: "0", - Port: 8080, + Port: createPointerFromInt(8080), Interval: "5s", Passes: 1, Fails: 1,