Skip to content

Commit 6e9de81

Browse files
committed
Fixed unit tests
1 parent f7707e3 commit 6e9de81

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

pkg/util/k8sutil/probes_test.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestCreate(t *testing.T) {
3434
secret := "the secret"
3535

3636
// http
37-
config := HTTPProbeConfig{path, false, secret, 0}
37+
config := HTTPProbeConfig{path, false, secret, 0, 0, 0, 0, 0, 0}
3838
probe := config.Create()
3939

4040
assert.Equal(t, probe.InitialDelaySeconds, int32(30))
@@ -50,8 +50,18 @@ func TestCreate(t *testing.T) {
5050
assert.Equal(t, probe.Handler.HTTPGet.Scheme, v1.URISchemeHTTP)
5151

5252
// https
53-
config = HTTPProbeConfig{path, true, secret, 0}
53+
config = HTTPProbeConfig{path, true, secret, 0, 0, 0, 0, 0, 0}
5454
probe = config.Create()
5555

5656
assert.Equal(t, probe.Handler.HTTPGet.Scheme, v1.URISchemeHTTPS)
57+
58+
// http, custom timing
59+
config = HTTPProbeConfig{path, false, secret, 0, 1, 2, 3, 4, 5}
60+
probe = config.Create()
61+
62+
assert.Equal(t, probe.InitialDelaySeconds, int32(1))
63+
assert.Equal(t, probe.TimeoutSeconds, int32(2))
64+
assert.Equal(t, probe.PeriodSeconds, int32(3))
65+
assert.Equal(t, probe.SuccessThreshold, int32(4))
66+
assert.Equal(t, probe.FailureThreshold, int32(5))
5767
}

0 commit comments

Comments
 (0)