From a884e03d2df343a85574dd3db16cf3b2b16206b6 Mon Sep 17 00:00:00 2001 From: Ewout Prangsma Date: Fri, 6 Apr 2018 08:58:41 +0200 Subject: [PATCH] Fixed expected value for ENGINE file in init container of dbserver. [ci LONG=1] [ci TESTOPTIONS="-test.run ^TestMemberResilienceDBServers$"] --- pkg/apis/deployment/v1alpha/storage_engine.go | 8 ++++++++ pkg/deployment/resources/pod_creator.go | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/apis/deployment/v1alpha/storage_engine.go b/pkg/apis/deployment/v1alpha/storage_engine.go index 01648f26a..6124b595d 100644 --- a/pkg/apis/deployment/v1alpha/storage_engine.go +++ b/pkg/apis/deployment/v1alpha/storage_engine.go @@ -23,6 +23,8 @@ package v1alpha import ( + "strings" + "github.com/pkg/errors" ) @@ -47,6 +49,12 @@ func (se StorageEngine) Validate() error { } } +// AsArangoArgument returns the value for the given storage engine as it is to be used +// for arangod's --server.storage-engine option. +func (se StorageEngine) AsArangoArgument() string { + return strings.ToLower(string(se)) +} + // NewStorageEngine returns a reference to a string with given value. func NewStorageEngine(input StorageEngine) *StorageEngine { return &input diff --git a/pkg/deployment/resources/pod_creator.go b/pkg/deployment/resources/pod_creator.go index a27fbb17e..8c3a2a44d 100644 --- a/pkg/deployment/resources/pod_creator.go +++ b/pkg/deployment/resources/pod_creator.go @@ -92,7 +92,7 @@ func createArangodArgs(apiObject metav1.Object, deplSpec api.DeploymentSpec, gro // Storage engine options = append(options, - optionPair{"--server.storage-engine", strings.ToLower(string(deplSpec.GetStorageEngine()))}, + optionPair{"--server.storage-engine", deplSpec.GetStorageEngine().AsArangoArgument()}, ) // Logging @@ -366,7 +366,7 @@ func (r *Resources) createPodForMember(spec api.DeploymentSpec, group api.Server SecretKey: constants.SecretKeyJWT, } } - engine := string(spec.GetStorageEngine()) + engine := spec.GetStorageEngine().AsArangoArgument() requireUUID := group == api.ServerGroupDBServers && m.IsInitialized if err := k8sutil.CreateArangodPod(kubecli, spec.IsDevelopment(), apiObject, role, m.ID, m.PodName, m.PersistentVolumeClaimName, info.ImageID, spec.GetImagePullPolicy(), engine, requireUUID, args, env, livenessProbe, readinessProbe, tlsKeyfileSecretName, rocksdbEncryptionSecretName); err != nil {