Skip to content

Commit db36758

Browse files
committed
Merge branch 'master' into feature/pod-finalizers
2 parents 5dad616 + 21fc9e6 commit db36758

File tree

2 files changed

+14
-28
lines changed

2 files changed

+14
-28
lines changed

pkg/apis/deployment/v1alpha/sync_spec_test.go

+12-26
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232

3333
func TestSyncSpecValidate(t *testing.T) {
3434
// Valid
35-
auth := AuthenticationSpec{JWTSecretName: util.NewString("foo")}
35+
auth := SyncAuthenticationSpec{JWTSecretName: util.NewString("foo"), ClientCASecretName: util.NewString("foo-client")}
3636
tls := TLSSpec{CASecretName: util.NewString("None")}
3737
assert.Nil(t, SyncSpec{Image: util.NewString("foo"), Authentication: auth}.Validate(DeploymentModeSingle))
3838
assert.Nil(t, SyncSpec{Image: util.NewString("foo"), Authentication: auth}.Validate(DeploymentModeActiveFailover))
@@ -49,7 +49,7 @@ func TestSyncSpecValidate(t *testing.T) {
4949

5050
func TestSyncSpecSetDefaults(t *testing.T) {
5151
def := func(spec SyncSpec) SyncSpec {
52-
spec.SetDefaults("test-image", v1.PullAlways, "test-jwt", "test-ca")
52+
spec.SetDefaults("test-image", v1.PullAlways, "test-jwt", "test-client-auth-ca", "test-tls-ca")
5353
return spec
5454
}
5555

@@ -61,7 +61,7 @@ func TestSyncSpecSetDefaults(t *testing.T) {
6161
assert.Equal(t, v1.PullAlways, def(SyncSpec{}).GetImagePullPolicy())
6262
assert.Equal(t, v1.PullNever, def(SyncSpec{ImagePullPolicy: util.NewPullPolicy(v1.PullNever)}).GetImagePullPolicy())
6363
assert.Equal(t, "test-jwt", def(SyncSpec{}).Authentication.GetJWTSecretName())
64-
assert.Equal(t, "foo", def(SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("foo")}}).Authentication.GetJWTSecretName())
64+
assert.Equal(t, "foo", def(SyncSpec{Authentication: SyncAuthenticationSpec{JWTSecretName: util.NewString("foo")}}).Authentication.GetJWTSecretName())
6565
}
6666

6767
func TestSyncSpecResetImmutableFields(t *testing.T) {
@@ -97,37 +97,23 @@ func TestSyncSpecResetImmutableFields(t *testing.T) {
9797
nil,
9898
},
9999
{
100-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("None")}},
101-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("None")}},
102-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("None")}},
100+
SyncSpec{Authentication: SyncAuthenticationSpec{JWTSecretName: util.NewString("None"), ClientCASecretName: util.NewString("some")}},
101+
SyncSpec{Authentication: SyncAuthenticationSpec{JWTSecretName: util.NewString("None"), ClientCASecretName: util.NewString("some")}},
102+
SyncSpec{Authentication: SyncAuthenticationSpec{JWTSecretName: util.NewString("None"), ClientCASecretName: util.NewString("some")}},
103103
nil,
104104
},
105105
{
106-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("foo")}},
107-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("foo")}},
108-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("foo")}},
106+
SyncSpec{Authentication: SyncAuthenticationSpec{JWTSecretName: util.NewString("foo"), ClientCASecretName: util.NewString("some")}},
107+
SyncSpec{Authentication: SyncAuthenticationSpec{JWTSecretName: util.NewString("foo"), ClientCASecretName: util.NewString("some")}},
108+
SyncSpec{Authentication: SyncAuthenticationSpec{JWTSecretName: util.NewString("foo"), ClientCASecretName: util.NewString("some")}},
109109
nil,
110110
},
111111
{
112-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("foo")}},
113-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("foo2")}},
114-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("foo2")}},
112+
SyncSpec{Authentication: SyncAuthenticationSpec{JWTSecretName: util.NewString("foo"), ClientCASecretName: util.NewString("some")}},
113+
SyncSpec{Authentication: SyncAuthenticationSpec{JWTSecretName: util.NewString("foo2"), ClientCASecretName: util.NewString("some")}},
114+
SyncSpec{Authentication: SyncAuthenticationSpec{JWTSecretName: util.NewString("foo2"), ClientCASecretName: util.NewString("some")}},
115115
nil,
116116
},
117-
118-
// Invalid changes
119-
{
120-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("foo")}},
121-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("None")}},
122-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("foo")}},
123-
[]string{"test.auth.jwtSecretName"},
124-
},
125-
{
126-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("None")}},
127-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("foo")}},
128-
SyncSpec{Authentication: AuthenticationSpec{JWTSecretName: util.NewString("None")}},
129-
[]string{"test.auth.jwtSecretName"},
130-
},
131117
}
132118

133119
for _, test := range tests {

pkg/util/k8sutil/probes_test.go

+2-2
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}
37+
config := HTTPProbeConfig{path, false, secret, 0}
3838
probe := config.Create()
3939

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

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

5656
assert.Equal(t, probe.Handler.HTTPGet.Scheme, v1.URISchemeHTTPS)

0 commit comments

Comments
 (0)