Skip to content

Commit

Permalink
CLOUDP-77913: Keep advance storage settings and log settings (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
gssbzn committed Dec 3, 2020
1 parent be91c7c commit 2fa30a4
Show file tree
Hide file tree
Showing 6 changed files with 340 additions and 61 deletions.
63 changes: 63 additions & 0 deletions e2e/cloud_manager/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand All @@ -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{}{},
},
},
},
},
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand All @@ -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{}{},
},
},
},
},
Expand All @@ -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),
Expand All @@ -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),
Expand All @@ -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{}{},
},
},
},
},
Expand Down
37 changes: 21 additions & 16 deletions internal/convert/automation_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -67,6 +69,9 @@ func TestFromAutomationConfig(t *testing.T) {
Mode: "Mode",
PEMKeyFile: "PEMKeyFile",
},
Security: &map[string]interface{}{
"test": "test",
},
},
},
},
Expand Down
35 changes: 24 additions & 11 deletions internal/convert/cluster_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
},
Expand All @@ -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,
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -217,7 +226,7 @@ func TestClusterConfig_PatchAutomationConfig(t *testing.T) {
DBPath: "/data",
},
SystemLog: opsmngr.SystemLog{
Destination: "file",
Destination: file,
Path: "/log",
},
},
Expand Down Expand Up @@ -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{}{
Expand Down Expand Up @@ -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",
},
},
Expand Down Expand Up @@ -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",
},
Expand Down
Loading

0 comments on commit 2fa30a4

Please sign in to comment.