Skip to content

Commit c62a4c3

Browse files
committed
Merge branch 'feature/sync-access-pkg' into feature/replication-status
2 parents 4dd12a4 + 9363869 commit c62a4c3

File tree

8 files changed

+45
-19
lines changed

8 files changed

+45
-19
lines changed

manifests/templates/deployment/deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,12 @@ spec:
5151
scheme: HTTPS
5252
initialDelaySeconds: 5
5353
periodSeconds: 10
54+
tolerations:
55+
- key: "node.kubernetes.io/unreachable"
56+
operator: "Exists"
57+
effect: "NoExecute"
58+
tolerationSeconds: 5
59+
- key: "node.kubernetes.io/not-ready"
60+
operator: "Exists"
61+
effect: "NoExecute"
62+
tolerationSeconds: 5

manifests/templates/deployment/rbac.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ rules:
3838

3939
---
4040

41-
## Bind the cluster role granting access to ArangoLocalStorage resources
41+
## Bind the cluster role granting access to ArangoDeployment resources
4242
## to the default service account of the configured namespace.
4343
apiVersion: rbac.authorization.k8s.io/v1beta1
4444
kind: RoleBinding

manifests/templates/storage/deployment.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,12 @@ spec:
5959
scheme: HTTPS
6060
initialDelaySeconds: 5
6161
periodSeconds: 10
62-
62+
tolerations:
63+
- key: "node.kubernetes.io/unreachable"
64+
operator: "Exists"
65+
effect: "NoExecute"
66+
tolerationSeconds: 5
67+
- key: "node.kubernetes.io/not-ready"
68+
operator: "Exists"
69+
effect: "NoExecute"
70+
tolerationSeconds: 5

pkg/apis/deployment/v1alpha/deployment.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ type ArangoDeployment struct {
5252
func (d *ArangoDeployment) AsOwner() metav1.OwnerReference {
5353
trueVar := true
5454
return metav1.OwnerReference{
55-
APIVersion: SchemeGroupVersion.String(),
56-
Kind: ArangoDeploymentResourceKind,
57-
Name: d.Name,
58-
UID: d.UID,
59-
Controller: &trueVar,
60-
BlockOwnerDeletion: &trueVar,
55+
APIVersion: SchemeGroupVersion.String(),
56+
Kind: ArangoDeploymentResourceKind,
57+
Name: d.Name,
58+
UID: d.UID,
59+
Controller: &trueVar,
60+
// For now BlockOwnerDeletion does not work on OpenShift, so we leave it out.
61+
//BlockOwnerDeletion: &trueVar,
6162
}
6263
}
6364

pkg/apis/deployment/v1alpha/monitoring_spec_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,15 @@ func TestMonitoringSpecValidate(t *testing.T) {
4242

4343
func TestMonitoringSpecSetDefaults(t *testing.T) {
4444
def := func(spec MonitoringSpec) MonitoringSpec {
45-
spec.SetDefaults()
45+
spec.SetDefaults("")
46+
return spec
47+
}
48+
def2 := func(spec MonitoringSpec) MonitoringSpec {
49+
spec.SetDefaults("def2")
4650
return spec
4751
}
4852

4953
assert.Equal(t, "", def(MonitoringSpec{}).GetTokenSecretName())
54+
assert.Equal(t, "def2", def2(MonitoringSpec{}).GetTokenSecretName())
5055
assert.Equal(t, "foo", def(MonitoringSpec{TokenSecretName: util.NewString("foo")}).GetTokenSecretName())
5156
}

pkg/apis/deployment/v1alpha/sync_spec_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ func TestSyncSpecValidate(t *testing.T) {
4545

4646
func TestSyncSpecSetDefaults(t *testing.T) {
4747
def := func(spec SyncSpec) SyncSpec {
48-
spec.SetDefaults("test-jwt", "test-client-auth-ca", "test-tls-ca")
48+
spec.SetDefaults("test-jwt", "test-client-auth-ca", "test-tls-ca", "test-mon")
4949
return spec
5050
}
5151

5252
assert.False(t, def(SyncSpec{}).IsEnabled())
5353
assert.False(t, def(SyncSpec{Enabled: util.NewBool(false)}).IsEnabled())
5454
assert.True(t, def(SyncSpec{Enabled: util.NewBool(true)}).IsEnabled())
5555
assert.Equal(t, "test-jwt", def(SyncSpec{}).Authentication.GetJWTSecretName())
56+
assert.Equal(t, "test-mon", def(SyncSpec{}).Monitoring.GetTokenSecretName())
5657
assert.Equal(t, "foo", def(SyncSpec{Authentication: SyncAuthenticationSpec{JWTSecretName: util.NewString("foo")}}).Authentication.GetJWTSecretName())
5758
}
5859

pkg/deployment/images.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ func (ib *imagesBuilder) fetchArangoDBImageIDAndVersion(ctx context.Context, ima
167167
args := []string{
168168
"--server.authentication=false",
169169
fmt.Sprintf("--server.endpoint=tcp://[::]:%d", k8sutil.ArangoPort),
170+
"--database.directory=" + k8sutil.ArangodVolumeMountDir,
171+
"--log.output=+",
170172
}
171173
terminationGracePeriod := time.Second * 30
172174
tolerations := make([]v1.Toleration, 0, 2)

pkg/util/k8sutil/secrets_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ func TestCreateEncryptionKeySecret(t *testing.T) {
8686
assert.Error(t, CreateEncryptionKeySecret(cli, "short-key", "ns", key))
8787
}
8888

89-
// TestGetJWTSecret tests GetJWTSecret.
90-
func TestGetJWTSecret(t *testing.T) {
89+
// TestGetTokenSecret tests GetTokenSecret.
90+
func TestGetTokenSecret(t *testing.T) {
9191
cli := mocks.NewCore()
9292

9393
// Prepare mock
@@ -104,17 +104,17 @@ func TestGetJWTSecret(t *testing.T) {
104104
}, nil)
105105
m.On("Get", "notfound", mock.Anything).Return(nil, apierrors.NewNotFound(schema.GroupResource{}, "notfound"))
106106

107-
token, err := GetJWTSecret(cli, "good", "ns")
107+
token, err := GetTokenSecret(cli, "good", "ns")
108108
assert.NoError(t, err)
109109
assert.Equal(t, token, "foo")
110-
_, err = GetJWTSecret(cli, "no-token", "ns")
110+
_, err = GetTokenSecret(cli, "no-token", "ns")
111111
assert.Error(t, err)
112-
_, err = GetJWTSecret(cli, "notfound", "ns")
112+
_, err = GetTokenSecret(cli, "notfound", "ns")
113113
assert.True(t, IsNotFound(err))
114114
}
115115

116-
// TestCreateJWTSecret tests CreateJWTSecret
117-
func TestCreateJWTSecret(t *testing.T) {
116+
// TestCreateTokenSecret tests CreateTokenSecret
117+
func TestCreateTokenSecret(t *testing.T) {
118118
cli := mocks.NewCore()
119119

120120
// Prepare mock
@@ -130,6 +130,6 @@ func TestCreateJWTSecret(t *testing.T) {
130130
}
131131
}).Return(nil, nil)
132132

133-
assert.NoError(t, CreateJWTSecret(cli, "good", "ns", "token", nil))
134-
assert.NoError(t, CreateJWTSecret(cli, "with-owner", "ns", "token", &metav1.OwnerReference{}))
133+
assert.NoError(t, CreateTokenSecret(cli, "good", "ns", "token", nil))
134+
assert.NoError(t, CreateTokenSecret(cli, "with-owner", "ns", "token", &metav1.OwnerReference{}))
135135
}

0 commit comments

Comments
 (0)