From abb2203af5c88889373fa3bac9ce0fda2fe2e9e5 Mon Sep 17 00:00:00 2001 From: John Murret Date: Sat, 18 Mar 2023 14:16:36 -0600 Subject: [PATCH] setting up test container builder to only set logStore for 1.15 and higher --- .../consul-container/libs/cluster/builder.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/integration/consul-container/libs/cluster/builder.go b/test/integration/consul-container/libs/cluster/builder.go index 9d30e6aea4..2807985e17 100644 --- a/test/integration/consul-container/libs/cluster/builder.go +++ b/test/integration/consul-container/libs/cluster/builder.go @@ -213,11 +213,18 @@ func NewConfigBuilder(ctx *BuildContext) *Builder { b.conf.Set("acl.default_policy", "deny") b.conf.Set("acl.enable_token_persistence", true) } + ls := string(ctx.logStore) - if ls != string(LogStore_WAL) && ls != string(LogStore_BoltDB) { - ls = string(LogStore_BoltDB) + if ls != "" && (ctx.consulVersion == "local" || + semver.Compare("v"+ctx.consulVersion, "v1.15.0") >= 0) { + // Enable logstore backend for version after v1.15.0 + if ls != string(LogStore_WAL) && ls != string(LogStore_BoltDB) { + ls = string(LogStore_BoltDB) + } + b.conf.Set("raft_logstore.backend", ls) + } else { + b.conf.Unset("raft_logstore.backend") } - b.conf.Set("raft_logstore.backend", ls) return b }