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 {