diff --git a/e2e/cloud_manager/helper_test.go b/e2e/cloud_manager/helper_test.go index 2859aa3b8c..e3ee68fc97 100644 --- a/e2e/cloud_manager/helper_test.go +++ b/e2e/cloud_manager/helper_test.go @@ -109,6 +109,13 @@ func generateRSConfig(filename, hostname, clusterName, version, fcVersion string Port: 27000, Priority: &one, Votes: &one, + WiredTiger: &map[string]interface{}{ + "collectionConfig": map[string]interface{}{}, + "engineConfig": map[string]interface{}{ + "cacheSizeGB": 1, + }, + "indexConfig": map[string]interface{}{}, + }, }, { DBPath: fmt.Sprintf("/data/%s/27001", clusterName), @@ -117,6 +124,13 @@ func generateRSConfig(filename, hostname, clusterName, version, fcVersion string Port: 27001, Priority: &one, Votes: &one, + WiredTiger: &map[string]interface{}{ + "collectionConfig": map[string]interface{}{}, + "engineConfig": map[string]interface{}{ + "cacheSizeGB": 1, + }, + "indexConfig": map[string]interface{}{}, + }, }, { DBPath: fmt.Sprintf("/data/%s/27002", clusterName), @@ -125,6 +139,13 @@ func generateRSConfig(filename, hostname, clusterName, version, fcVersion string Port: 27002, Priority: &one, Votes: &one, + WiredTiger: &map[string]interface{}{ + "collectionConfig": map[string]interface{}{}, + "engineConfig": map[string]interface{}{ + "cacheSizeGB": 1, + }, + "indexConfig": map[string]interface{}{}, + }, }, }, }, @@ -159,6 +180,13 @@ func generateShardedConfig(filename, hostname, clusterName, version, fcVersion s Port: 29000, Priority: &one, Votes: &one, + WiredTiger: &map[string]interface{}{ + "collectionConfig": map[string]interface{}{}, + "engineConfig": map[string]interface{}{ + "cacheSizeGB": 1, + }, + "indexConfig": map[string]interface{}{}, + }, }, { DBPath: fmt.Sprintf("/data/%s/29001", clusterName), @@ -167,6 +195,13 @@ func generateShardedConfig(filename, hostname, clusterName, version, fcVersion s Port: 29001, Priority: &one, Votes: &one, + WiredTiger: &map[string]interface{}{ + "collectionConfig": map[string]interface{}{}, + "engineConfig": map[string]interface{}{ + "cacheSizeGB": 1, + }, + "indexConfig": map[string]interface{}{}, + }, }, { DBPath: fmt.Sprintf("/data/%s/29002", clusterName), @@ -175,6 +210,13 @@ func generateShardedConfig(filename, hostname, clusterName, version, fcVersion s Port: 29002, Priority: &one, Votes: &one, + WiredTiger: &map[string]interface{}{ + "collectionConfig": map[string]interface{}{}, + "engineConfig": map[string]interface{}{ + "cacheSizeGB": 1, + }, + "indexConfig": map[string]interface{}{}, + }, }, }, }, @@ -196,6 +238,13 @@ func generateShardedConfig(filename, hostname, clusterName, version, fcVersion s Port: 27000, Priority: &one, Votes: &one, + WiredTiger: &map[string]interface{}{ + "collectionConfig": map[string]interface{}{}, + "engineConfig": map[string]interface{}{ + "cacheSizeGB": 1, + }, + "indexConfig": map[string]interface{}{}, + }, }, { DBPath: fmt.Sprintf("/data/%s/27001", clusterName), @@ -204,6 +253,13 @@ func generateShardedConfig(filename, hostname, clusterName, version, fcVersion s Port: 27001, Priority: &one, Votes: &one, + WiredTiger: &map[string]interface{}{ + "collectionConfig": map[string]interface{}{}, + "engineConfig": map[string]interface{}{ + "cacheSizeGB": 1, + }, + "indexConfig": map[string]interface{}{}, + }, }, { DBPath: fmt.Sprintf("/data/%s/27002", clusterName), @@ -212,6 +268,13 @@ func generateShardedConfig(filename, hostname, clusterName, version, fcVersion s Port: 27002, Priority: &one, Votes: &one, + WiredTiger: &map[string]interface{}{ + "collectionConfig": map[string]interface{}{}, + "engineConfig": map[string]interface{}{ + "cacheSizeGB": 1, + }, + "indexConfig": map[string]interface{}{}, + }, }, }, }, diff --git a/internal/convert/automation_config_test.go b/internal/convert/automation_config_test.go index 6b078fe8a1..c028a277e8 100644 --- a/internal/convert/automation_config_test.go +++ b/internal/convert/automation_config_test.go @@ -37,22 +37,24 @@ func TestFromAutomationConfig(t *testing.T) { Name: name, ProcessConfigs: []*ProcessConfig{ { - ArbiterOnly: &f, - BuildIndexes: &buildIndexes, - DBPath: "/data/db/", - Disabled: false, - Hidden: &f, - Hostname: "host0", - LogPath: "/data/db/mongodb.log", - LogDestination: file, - Port: 27017, - Priority: &one, - ProcessType: mongod, - SlaveDelay: &zero, - Votes: &one, - FCVersion: "4.2", - Version: "4.2.2", - Name: name + "_0", + ArbiterOnly: &f, + BuildIndexes: &buildIndexes, + DBPath: "/data/db/", + Disabled: false, + Hidden: &f, + Hostname: "host0", + LogPath: "/data/db/mongodb.log", + LogDestination: file, + AuditLogDestination: file, + AuditLogPath: "/data/db/audit.log", + Port: 27017, + Priority: &one, + ProcessType: mongod, + SlaveDelay: &zero, + Votes: &one, + FCVersion: "4.2", + Version: "4.2.2", + Name: name + "_0", TLS: &TLS{ CAFile: "CAFile", CertificateKeyFile: "CertificateKeyFile", @@ -67,6 +69,9 @@ func TestFromAutomationConfig(t *testing.T) { Mode: "Mode", PEMKeyFile: "PEMKeyFile", }, + Security: &map[string]interface{}{ + "test": "test", + }, }, }, }, diff --git a/internal/convert/cluster_config_test.go b/internal/convert/cluster_config_test.go index 60613c72fc..8ef804143c 100644 --- a/internal/convert/cluster_config_test.go +++ b/internal/convert/cluster_config_test.go @@ -41,12 +41,13 @@ func TestClusterConfig_PatchAutomationConfig(t *testing.T) { Version: "4.2.2", ProcessConfigs: []*ProcessConfig{ { - DBPath: "/data", - Hostname: "example", - LogPath: "/log", - Port: 1, - Priority: &one, - Votes: &one, + DBPath: "/data", + Hostname: "example", + LogPath: "/log", + Port: 1, + Priority: &one, + Votes: &one, + AuditLogPath: "/audit", }, }, }, @@ -66,9 +67,13 @@ func TestClusterConfig_PatchAutomationConfig(t *testing.T) { DBPath: "/data", }, SystemLog: opsmngr.SystemLog{ - Destination: "file", + Destination: file, Path: "/log", }, + AuditLog: &opsmngr.AuditLog{ + Destination: file, + Path: "/audit", + }, }, LogRotate: &opsmngr.LogRotate{ SizeThresholdMB: 1000, @@ -170,9 +175,13 @@ func TestClusterConfig_PatchAutomationConfig(t *testing.T) { DBPath: "/data/db/", }, SystemLog: opsmngr.SystemLog{ - Destination: "file", + Destination: file, Path: "/data/db/mongodb.log", }, + AuditLog: &opsmngr.AuditLog{ + Destination: file, + Path: "/data/db/audit.log", + }, Security: &map[string]interface{}{ "test": "test", }, @@ -217,7 +226,7 @@ func TestClusterConfig_PatchAutomationConfig(t *testing.T) { DBPath: "/data", }, SystemLog: opsmngr.SystemLog{ - Destination: "file", + Destination: file, Path: "/log", }, }, @@ -315,7 +324,7 @@ func TestClusterConfig_PatchAutomationConfig(t *testing.T) { DBPath: "/data/db/", }, SystemLog: opsmngr.SystemLog{ - Destination: "file", + Destination: file, Path: "/data/db/mongodb.log", }, Security: &map[string]interface{}{ @@ -346,7 +355,7 @@ func TestClusterConfig_PatchAutomationConfig(t *testing.T) { DBPath: "/data/db/", }, SystemLog: opsmngr.SystemLog{ - Destination: "file", + Destination: file, Path: "/data/db/mongodb.log", }, }, @@ -446,6 +455,10 @@ func TestClusterConfig_PatchAutomationConfig(t *testing.T) { Destination: file, Path: "/data/db/mongodb.log", }, + AuditLog: &opsmngr.AuditLog{ + Destination: file, + Path: "/data/db/audit.log", + }, Security: &map[string]interface{}{ "test": "test", }, diff --git a/internal/convert/process_config.go b/internal/convert/process_config.go index 5cead18fcb..5ba44af0b5 100644 --- a/internal/convert/process_config.go +++ b/internal/convert/process_config.go @@ -29,29 +29,42 @@ const ( // ProcessConfig that belongs to a cluster type ProcessConfig struct { - AuditLogPath string `yaml:"auditLogPath,omitempty" json:"auditLogPath,omitempty"` - AuditLogDestination string `yaml:"auditLogDestination,omitempty" json:"auditLogDestination,omitempty"` - AuditLogFormat string `yaml:"auditLogFormat,omitempty" json:"auditLogFormat,omitempty"` - BuildIndexes *bool `yaml:"buildIndexes,omitempty" json:"buildIndexes,omitempty"` - DBPath string `yaml:"dbPath,omitempty" json:"dbPath,omitempty"` - BindIP *string `yaml:"bindIp,omitempty" json:"bindIp,omitempty"` - BindIPAll *bool `yaml:"bindIpAll,omitempty" json:"bindIpAll,omitempty"` - FCVersion string `yaml:"featureCompatibilityVersion,omitempty" json:"featureCompatibilityVersion,omitempty"` - Hostname string `yaml:"hostname" json:"hostname"` - IPV6 *bool `yaml:"ipv6,omitempty" json:"ipv6,omitempty"` - LogPath string `yaml:"logPath" json:"logPath"` - LogDestination string `yaml:"logDestination,omitempty" json:"logDestination,omitempty"` - Name string `yaml:"name,omitempty" json:"name,omitempty"` - Port int `yaml:"port" json:"port"` - Priority *float64 `yaml:"priority,omitempty" json:"priority,omitempty"` - ProcessType string `yaml:"processType" json:"processType"` - SlaveDelay *float64 `yaml:"slaveDelay,omitempty" json:"slaveDelay,omitempty"` - Version string `yaml:"version,omitempty" json:"version,omitempty"` - Votes *float64 `yaml:"votes,omitempty" json:"votes,omitempty"` - ArbiterOnly *bool `yaml:"arbiterOnly,omitempty" json:"arbiterOnly,omitempty"` - Disabled bool `yaml:"disabled" json:"disabled"` - Hidden *bool `yaml:"hidden,omitempty" json:"hidden,omitempty"` - TLS *TLS `yaml:"tls,omitempty" json:"tls,omitempty"` + AuditLogPath string `yaml:"auditLogPath,omitempty" json:"auditLogPath,omitempty"` + AuditLogDestination string `yaml:"auditLogDestination,omitempty" json:"auditLogDestination,omitempty"` + AuditLogFormat string `yaml:"auditLogFormat,omitempty" json:"auditLogFormat,omitempty"` + AuditLogFilter string `yaml:"auditLogFilter,omitempty" json:"auditLogFilter,omitempty"` + BuildIndexes *bool `yaml:"buildIndexes,omitempty" json:"buildIndexes,omitempty"` + DBPath string `yaml:"dbPath,omitempty" json:"dbPath,omitempty"` + BindIP *string `yaml:"bindIp,omitempty" json:"bindIp,omitempty"` + BindIPAll *bool `yaml:"bindIpAll,omitempty" json:"bindIpAll,omitempty"` + DirectoryPerDB *bool `yaml:"directoryPerDB,omitempty" json:"directoryPerDB,omitempty"` + Engine string `yaml:"engine,omitempty" json:"engine,omitempty"` + FCVersion string `yaml:"featureCompatibilityVersion,omitempty" json:"featureCompatibilityVersion,omitempty"` + Hostname string `yaml:"hostname" json:"hostname"` + InMemory *map[string]interface{} `yaml:"inMemory,omitempty" json:"inMemory,omitempty"` + IndexBuildRetry *bool `yaml:"indexBuildRetry,omitempty" json:"indexBuildRetry,omitempty"` + IPV6 *bool `yaml:"ipv6,omitempty" json:"ipv6,omitempty"` + Journal *map[string]interface{} `yaml:"journal,omitempty" json:"journal,omitempty"` + LogAppend bool `yaml:"logAppend,omitempty" json:"logAppend,omitempty"` + LogDestination string `yaml:"logDestination,omitempty" json:"logDestination,omitempty"` + LogPath string `yaml:"logPath" json:"logPath"` + LogRotate string `yaml:"logRotate,omitempty" json:"logRotate,omitempty"` + LogVerbosity int `yaml:"logVerbosity,omitempty" json:"logVerbosity,omitempty"` + Name string `yaml:"name,omitempty" json:"name,omitempty"` + OplogMinRetentionHours *float64 `yaml:"oplogMinRetentionHours,omitempty" json:"oplogMinRetentionHours,omitempty"` + Port int `yaml:"port" json:"port"` + Priority *float64 `yaml:"priority,omitempty" json:"priority,omitempty"` + ProcessType string `yaml:"processType" json:"processType"` + SlaveDelay *float64 `yaml:"slaveDelay,omitempty" json:"slaveDelay,omitempty"` + SyncPeriodSecs *float64 `yaml:"syncPeriodSecs,omitempty" json:"syncPeriodSecs,omitempty"` + Votes *float64 `yaml:"votes,omitempty" json:"votes,omitempty"` + ArbiterOnly *bool `yaml:"arbiterOnly,omitempty" json:"arbiterOnly,omitempty"` + Disabled bool `yaml:"disabled" json:"disabled"` + Hidden *bool `yaml:"hidden,omitempty" json:"hidden,omitempty"` + Security *map[string]interface{} `yaml:"security,omitempty" json:"security,omitempty"` + TLS *TLS `yaml:"tls,omitempty" json:"tls,omitempty"` + Version string `yaml:"version,omitempty" json:"version,omitempty"` + WiredTiger *map[string]interface{} `yaml:"wiredTiger,omitempty" json:"wiredTiger,omitempty"` } // TLS defines TLS parameters for Net @@ -120,9 +133,11 @@ func newReplicaSetProcessConfig(rs opsmngr.Member, p *opsmngr.Process) *ProcessC Votes: &rs.Votes, ArbiterOnly: &rs.ArbiterOnly, Hidden: &rs.Hidden, - DBPath: p.Args26.Storage.DBPath, LogPath: p.Args26.SystemLog.Path, LogDestination: p.Args26.SystemLog.Destination, + LogAppend: p.Args26.SystemLog.LogAppend, + LogVerbosity: p.Args26.SystemLog.Verbosity, + LogRotate: p.Args26.SystemLog.LogRotate, Port: p.Args26.NET.Port, BindIP: p.Args26.NET.BindIP, BindIPAll: p.Args26.NET.BindIPAll, @@ -133,10 +148,22 @@ func newReplicaSetProcessConfig(rs opsmngr.Member, p *opsmngr.Process) *ProcessC Hostname: p.Hostname, Name: p.Name, } + + if p.Args26.Storage != nil { + pc.DBPath = p.Args26.Storage.DBPath + pc.DirectoryPerDB = p.Args26.Storage.DirectoryPerDB + pc.SyncPeriodSecs = p.Args26.Storage.SyncPeriodSecs + pc.Engine = p.Args26.Storage.Engine + pc.WiredTiger = p.Args26.Storage.WiredTiger + pc.OplogMinRetentionHours = p.Args26.Storage.OplogMinRetentionHours + pc.Journal = p.Args26.Storage.Journal + } + if p.Args26.AuditLog != nil { pc.AuditLogDestination = p.Args26.AuditLog.Destination pc.AuditLogFormat = p.Args26.AuditLog.Format pc.AuditLogPath = p.Args26.AuditLog.Path + pc.AuditLogFilter = p.Args26.AuditLog.Filter } if p.Args26.NET.TLS != nil { @@ -155,21 +182,56 @@ func newReplicaSetProcessConfig(rs opsmngr.Member, p *opsmngr.Process) *ProcessC PEMKeyFile: p.Args26.NET.TLS.PEMKeyFile, } } + if p.Args26.Security != nil { + pc.Security = p.Args26.Security + } return pc } // newMongosProcessConfig maps opsmngr.Process -> convert.ProcessConfig func newMongosProcessConfig(p *opsmngr.Process) *ProcessConfig { - return &ProcessConfig{ + pc := &ProcessConfig{ LogPath: p.Args26.SystemLog.Path, LogDestination: p.Args26.SystemLog.Destination, + LogAppend: p.Args26.SystemLog.LogAppend, + LogVerbosity: p.Args26.SystemLog.Verbosity, + LogRotate: p.Args26.SystemLog.LogRotate, Port: p.Args26.NET.Port, + BindIP: p.Args26.NET.BindIP, + BindIPAll: p.Args26.NET.BindIPAll, + IPV6: p.Args26.NET.IPV6, ProcessType: p.ProcessType, Version: p.Version, FCVersion: p.FeatureCompatibilityVersion, Hostname: p.Hostname, Name: p.Name, } + if p.Args26.AuditLog != nil { + pc.AuditLogDestination = p.Args26.AuditLog.Destination + pc.AuditLogFormat = p.Args26.AuditLog.Format + pc.AuditLogPath = p.Args26.AuditLog.Path + pc.AuditLogFilter = p.Args26.AuditLog.Filter + } + if p.Args26.NET.TLS != nil { + pc.TLS = &TLS{ + CAFile: p.Args26.NET.TLS.CAFile, + CertificateKeyFile: p.Args26.NET.TLS.CertificateKeyFile, + CertificateKeyFilePassword: p.Args26.NET.TLS.CertificateKeyFilePassword, + CertificateSelector: p.Args26.NET.TLS.CertificateSelector, + ClusterCertificateSelector: p.Args26.NET.TLS.ClusterCertificateSelector, + ClusterFile: p.Args26.NET.TLS.ClusterFile, + ClusterPassword: p.Args26.NET.TLS.ClusterPassword, + CRLFile: p.Args26.NET.TLS.CRLFile, + DisabledProtocols: p.Args26.NET.TLS.DisabledProtocols, + FIPSMode: p.Args26.NET.TLS.FIPSMode, + Mode: p.Args26.NET.TLS.Mode, + PEMKeyFile: p.Args26.NET.TLS.PEMKeyFile, + } + } + if p.Args26.Security != nil { + pc.Security = p.Args26.Security + } + return pc } // newMongosProcess generates a mongo process for a mongos @@ -180,6 +242,9 @@ func newMongosProcess(p *ProcessConfig, cluster string) *opsmngr.Process { NET: p.net(), SystemLog: p.systemLog(), } + if p.Security != nil { + process.Args26.Security = p.Security + } process.LogRotate = newLogRotate() if p.AuditLogPath != "" { process.Args26.AuditLog = p.auditLog() @@ -196,11 +261,12 @@ func newReplicaSetProcess(p *ProcessConfig, replSetName string) *opsmngr.Process Replication: &opsmngr.Replication{ ReplSetName: replSetName, }, - Storage: &opsmngr.Storage{ - DBPath: p.DBPath, - }, + Storage: p.storage(), SystemLog: p.systemLog(), } + if p.Security != nil { + process.Args26.Security = p.Security + } process.LogRotate = newLogRotate() if p.AuditLogPath != "" { process.Args26.AuditLog = p.auditLog() @@ -217,12 +283,13 @@ func newConfigRSProcess(p *ProcessConfig, rsSetName string) *opsmngr.Process { Replication: &opsmngr.Replication{ ReplSetName: rsSetName, }, - Storage: &opsmngr.Storage{ - DBPath: p.DBPath, - }, + Storage: p.storage(), Sharding: &opsmngr.Sharding{ClusterRole: "configsvr"}, SystemLog: p.systemLog(), } + if p.Security != nil { + process.Args26.Security = p.Security + } process.LogRotate = newLogRotate() if p.AuditLogPath != "" { process.Args26.AuditLog = p.auditLog() @@ -231,7 +298,7 @@ func newConfigRSProcess(p *ProcessConfig, rsSetName string) *opsmngr.Process { return process } -// systemLog maps convert.ProcessConfig -> opsmngr.Net +// net maps convert.ProcessConfig -> opsmngr.Net func (p *ProcessConfig) net() opsmngr.Net { net := opsmngr.Net{ Port: p.Port, @@ -258,11 +325,28 @@ func (p *ProcessConfig) net() opsmngr.Net { return net } +// storage maps convert.ProcessConfig -> opsmngr.Storage +func (p *ProcessConfig) storage() *opsmngr.Storage { + return &opsmngr.Storage{ + DBPath: p.DBPath, + DirectoryPerDB: p.DirectoryPerDB, + SyncPeriodSecs: p.SyncPeriodSecs, + Engine: p.Engine, + WiredTiger: p.WiredTiger, + InMemory: p.InMemory, + OplogMinRetentionHours: p.OplogMinRetentionHours, + Journal: p.Journal, + } +} + // systemLog maps convert.ProcessConfig -> opsmngr.SystemLog func (p *ProcessConfig) systemLog() opsmngr.SystemLog { return opsmngr.SystemLog{ Destination: p.systemLogDestination(), Path: p.LogPath, + LogAppend: p.LogAppend, + Verbosity: p.LogVerbosity, + LogRotate: p.LogRotate, } } @@ -276,12 +360,19 @@ func (p *ProcessConfig) systemLogDestination() string { // auditLog maps convert.ProcessConfig -> opsmngr.AuditLog func (p *ProcessConfig) auditLog() *opsmngr.AuditLog { return &opsmngr.AuditLog{ - Destination: p.AuditLogDestination, + Destination: p.auditLogDestination(), Path: p.AuditLogPath, Format: p.AuditLogFormat, } } +func (p *ProcessConfig) auditLogDestination() string { + if p.AuditLogDestination != "" { + return p.AuditLogDestination + } + return file +} + // process maps convert.ProcessConfig -> opsmngr.Process func (p *ProcessConfig) process() *opsmngr.Process { process := &opsmngr.Process{ diff --git a/internal/convert/process_config_test.go b/internal/convert/process_config_test.go new file mode 100644 index 0000000000..4561bf9702 --- /dev/null +++ b/internal/convert/process_config_test.go @@ -0,0 +1,104 @@ +package convert + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "go.mongodb.org/ops-manager/opsmngr" +) + +func TestNewReplicaSetProcessConfig(t *testing.T) { + trueValue := true + omp := &opsmngr.Process{ + Args26: opsmngr.Args26{ + AuditLog: &opsmngr.AuditLog{ + Destination: "file", + Path: "/data/audit.log", + Format: "JSON", + Filter: "{ atype: { $in: [ \"createCollection\", \"dropCollection\" ] } }", + }, + NET: opsmngr.Net{ + Port: 27017, + TLS: &opsmngr.TLS{Mode: "disabled"}, + }, + Replication: &opsmngr.Replication{ + ReplSetName: "myReplicaSet", + }, + Storage: &opsmngr.Storage{ + DBPath: "/data/db", + DirectoryPerDB: &trueValue, + WiredTiger: &map[string]interface{}{ + "collectionConfig": map[string]interface{}{}, + "engineConfig": map[string]interface{}{ + "cacheSizeGB": 1, + }, + "indexConfig": map[string]interface{}{}, + }, + }, + SystemLog: opsmngr.SystemLog{ + Destination: "file", + Path: "/data/log/mongodb.log", + }, + }, + AuthSchemaVersion: 5, + Disabled: false, + FeatureCompatibilityVersion: "4.4", + Hostname: "n1.omansible.int", + LogRotate: &opsmngr.LogRotate{ + SizeThresholdMB: 1000, + TimeThresholdHrs: 24, + }, + ManualMode: false, + Name: "myReplicaSet_1", + ProcessType: "mongod", + Version: "4.4.1-ent", + } + omm := opsmngr.Member{ + ID: 0, + ArbiterOnly: false, + BuildIndexes: true, + Hidden: false, + Host: "myReplicaSet_1", + Priority: 1, + SlaveDelay: 0, + Votes: 1, + } + + one := 1.0 + zero := 0.0 + falseValue := false + expected := &ProcessConfig{ + AuditLogPath: "/data/audit.log", + AuditLogDestination: "file", + AuditLogFormat: "JSON", + AuditLogFilter: "{ atype: { $in: [ \"createCollection\", \"dropCollection\" ] } }", + BuildIndexes: &trueValue, + DBPath: "/data/db", + DirectoryPerDB: &trueValue, + FCVersion: "4.4", + Hostname: "n1.omansible.int", + LogDestination: "file", + LogPath: "/data/log/mongodb.log", + Name: "myReplicaSet_1", + Port: 27017, + Priority: &one, + ProcessType: "mongod", + SlaveDelay: &zero, + Version: "4.4.1-ent", + Votes: &one, + ArbiterOnly: &falseValue, + Disabled: false, + Hidden: &falseValue, + TLS: &TLS{Mode: "disabled"}, + WiredTiger: &map[string]interface{}{ + "collectionConfig": map[string]interface{}{}, + "engineConfig": map[string]interface{}{ + "cacheSizeGB": 1, + }, + "indexConfig": map[string]interface{}{}, + }, + } + result := newReplicaSetProcessConfig(omm, omp) + + assert.Equal(t, expected, result) +} diff --git a/internal/fixture/automation_configs.go b/internal/fixture/automation_configs.go index 0474ff3662..abe5f2d643 100644 --- a/internal/fixture/automation_configs.go +++ b/internal/fixture/automation_configs.go @@ -192,7 +192,6 @@ func AutomationConfigWithOneReplicaSet(name string, disabled bool) *opsmngr.Auto Storage: &opsmngr.Storage{ DBPath: "/data/db/", }, - Security: &map[string]interface{}{ "test": "test", }, @@ -200,6 +199,10 @@ func AutomationConfigWithOneReplicaSet(name string, disabled bool) *opsmngr.Auto Destination: "file", Path: "/data/db/mongodb.log", }, + AuditLog: &opsmngr.AuditLog{ + Destination: "file", + Path: "/data/db/audit.log", + }, }, AuthSchemaVersion: defaultAuthSchemaVersion, Name: name + "_0",