Skip to content

Commit

Permalink
CLOUDP-84841: Allow to update security and setparams (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
gssbzn authored Mar 15, 2021
1 parent 6bea17b commit c5a4d65
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
6 changes: 0 additions & 6 deletions internal/convert/cluster_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,6 @@ func keepSettings(oldProcess *opsmngr.Process, newProcesses []*opsmngr.Process,
if oldProcess.Args26.ProcessManagement != nil {
newProcesses[pos].Args26.ProcessManagement = oldProcess.Args26.ProcessManagement
}
if oldProcess.Args26.Security != nil {
newProcesses[pos].Args26.Security = oldProcess.Args26.Security
}
if oldProcess.Args26.SetParameter != nil {
newProcesses[pos].Args26.SetParameter = oldProcess.Args26.SetParameter
}
if oldProcess.Args26.SNMP != nil {
newProcesses[pos].Args26.SNMP = oldProcess.Args26.SNMP
}
Expand Down
15 changes: 12 additions & 3 deletions internal/convert/cluster_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,12 @@ func TestClusterConfig_PatchAutomationConfig(t *testing.T) {
Port: 27017,
Priority: pointy.Float64(1),
Votes: pointy.Float64(1),
Security: &map[string]interface{}{
"test": "test",
},
SetParameter: &map[string]interface{}{
"test": "test",
},
},
},
},
Expand All @@ -326,9 +332,6 @@ func TestClusterConfig_PatchAutomationConfig(t *testing.T) {
Destination: file,
Path: "/data/db/mongodb.log",
},
Security: &map[string]interface{}{
"test": "test",
},
},
LogRotate: &opsmngr.LogRotate{
SizeThresholdMB: 1000,
Expand Down Expand Up @@ -357,6 +360,12 @@ func TestClusterConfig_PatchAutomationConfig(t *testing.T) {
Destination: file,
Path: "/data/db/mongodb.log",
},
Security: &map[string]interface{}{
"test": "test",
},
SetParameter: &map[string]interface{}{
"test": "test",
},
},
LogRotate: &opsmngr.LogRotate{
SizeThresholdMB: 1000,
Expand Down
6 changes: 4 additions & 2 deletions internal/convert/process_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ func Test_newReplicaSetProcess(t *testing.T) {
"indexConfig": map[string]interface{}{},
},
SetParameter: &map[string]interface{}{
"param": "param",
"enableLocalhostAuthBypass": "false",
"auditAuthorizationSuccess": "true",
},
}

Expand Down Expand Up @@ -359,7 +360,8 @@ func Test_newReplicaSetProcess(t *testing.T) {
Path: "/data/log/mongodb.log",
},
SetParameter: &map[string]interface{}{
"param": "param",
"enableLocalhostAuthBypass": "false",
"auditAuthorizationSuccess": "true",
},
},
AuthSchemaVersion: 5,
Expand Down

0 comments on commit c5a4d65

Please sign in to comment.