Skip to content

Commit

Permalink
Fix transport server health checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ciarams87 committed Jan 26, 2022
1 parent fca5ef2 commit cec916e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions internal/configs/transportserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions internal/configs/transportserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -642,7 +642,6 @@ func TestGenerateTransportServerHealthChecks(t *testing.T) {
Enabled: true,
Timeout: "5s",
Jitter: "0s",
Port: 90,
Interval: "5s",
Passes: 1,
Fails: 1,
Expand All @@ -668,7 +667,6 @@ func TestGenerateTransportServerHealthChecks(t *testing.T) {
Enabled: true,
Timeout: "5s",
Jitter: "0s",
Port: 90,
Interval: "5s",
Passes: 1,
Fails: 1,
Expand Down
2 changes: 1 addition & 1 deletion internal/configs/version2/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type StreamServer struct {
type StreamHealthCheck struct {
Enabled bool
Interval string
Port int
Port *int
Passes int
Jitter string
Fails int
Expand Down
2 changes: 1 addition & 1 deletion internal/configs/version2/templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ var transportServerCfg = TransportServerConfig{
Enabled: false,
Timeout: "5s",
Jitter: "0",
Port: 8080,
Port: createPointerFromInt(8080),
Interval: "5s",
Passes: 1,
Fails: 1,
Expand Down

0 comments on commit cec916e

Please sign in to comment.