diff --git a/api/v1/mongodbcommunity_types.go b/api/v1/mongodbcommunity_types.go index 0f7128713..8c78b8a4e 100644 --- a/api/v1/mongodbcommunity_types.go +++ b/api/v1/mongodbcommunity_types.go @@ -356,10 +356,10 @@ type LogLevel string const ( LogLevelDebug LogLevel = "DEBUG" - LogLevelInfo string = "INFO" - LogLevelWarn string = "WARN" - LogLevelError string = "ERROR" - LogLevelFatal string = "FATAL" + LogLevelInfo LogLevel = "INFO" + LogLevelWarn LogLevel = "WARN" + LogLevelError LogLevel = "ERROR" + LogLevelFatal LogLevel = "FATAL" ) type AgentConfiguration struct { diff --git a/controllers/construct/build_statefulset_test.go b/controllers/construct/build_statefulset_test.go index bb5dceeaa..56e3bcaac 100644 --- a/controllers/construct/build_statefulset_test.go +++ b/controllers/construct/build_statefulset_test.go @@ -177,14 +177,14 @@ func TestMongod_Container(t *testing.T) { } func TestMongoDBAgentCommand(t *testing.T) { - cmd := AutomationAgentCommand(false, "INFO", "testfile", 24) + cmd := AutomationAgentCommand(false, mdbv1.LogLevelInfo, "testfile", 24) baseCmd := MongodbUserCommand + BaseAgentCommand() + " -cluster=" + clusterFilePath + automationAgentOptions assert.Len(t, cmd, 3) assert.Equal(t, cmd[0], "/bin/bash") assert.Equal(t, cmd[1], "-c") assert.Equal(t, cmd[2], baseCmd+" -logFile testfile -logLevel INFO -maxLogFileDurationHrs 24") - cmd = AutomationAgentCommand(false, "INFO", "/dev/stdout", 24) + cmd = AutomationAgentCommand(false, mdbv1.LogLevelInfo, "/dev/stdout", 24) assert.Len(t, cmd, 3) assert.Equal(t, cmd[0], "/bin/bash") assert.Equal(t, cmd[1], "-c") diff --git a/controllers/construct/mongodbstatefulset.go b/controllers/construct/mongodbstatefulset.go index 2ef3ac8a7..a6a71ff9b 100644 --- a/controllers/construct/mongodbstatefulset.go +++ b/controllers/construct/mongodbstatefulset.go @@ -207,7 +207,7 @@ func BuildMongoDBReplicaSetStatefulSetModificationFunction(mdb MongoDBStatefulSe agentLogLevel := mdbv1.LogLevelInfo if mdb.GetAgentLogLevel() != "" { - agentLogLevel = string(mdb.GetAgentLogLevel()) + agentLogLevel = mdb.GetAgentLogLevel() } agentLogFile := automationconfig.DefaultAgentLogFile