Skip to content

Commit

Permalink
feat: add default for new properties in Upstream
Browse files Browse the repository at this point in the history
go-kong v0.4.0 introduces new properties to Upstream related to HTTPS
Active healthc-checks.

If these fields are not set in the default filler, it results in a false
diff.
  • Loading branch information
hbagdi committed Apr 13, 2019
1 parent 0cf17a2 commit 080200d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions utils/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ var (
Interval: kong.Int(0),
Successes: kong.Int(0),
},
HTTPPath: kong.String("/"),
Timeout: kong.Int(1),
HTTPPath: kong.String("/"),
HTTPSVerifyCertificate: kong.Bool(true),
Type: kong.String("http"),
Timeout: kong.Int(1),
Unhealthy: &kong.Unhealthy{
HTTPFailures: kong.Int(0),
TCPFailures: kong.Int(0),
Expand Down
12 changes: 8 additions & 4 deletions utils/defaulter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@ func TestUpstreamSetTest(t *testing.T) {
Interval: kong.Int(0),
Successes: kong.Int(0),
},
HTTPPath: kong.String("/"),
Timeout: kong.Int(1),
HTTPPath: kong.String("/"),
HTTPSVerifyCertificate: kong.Bool(true),
Type: kong.String("http"),
Timeout: kong.Int(1),
Unhealthy: &kong.Unhealthy{
HTTPFailures: kong.Int(0),
TCPFailures: kong.Int(0),
Expand Down Expand Up @@ -277,8 +279,10 @@ func TestUpstreamSetTest(t *testing.T) {
Interval: kong.Int(1),
Successes: kong.Int(0),
},
HTTPPath: kong.String("/"),
Timeout: kong.Int(1),
HTTPPath: kong.String("/"),
HTTPSVerifyCertificate: kong.Bool(true),
Type: kong.String("http"),
Timeout: kong.Int(1),
Unhealthy: &kong.Unhealthy{
HTTPFailures: kong.Int(0),
TCPFailures: kong.Int(0),
Expand Down

0 comments on commit 080200d

Please sign in to comment.