Skip to content

Commit ef28518

Browse files
HELP-28512: mongocli cannot handle net.tls.FIPSMode properly (#128)
1 parent aeaca76 commit ef28518

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

opsmngr/automation_config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ type TLS struct {
249249
ClusterPassword string `json:"clusterPassword,omitempty"`
250250
CRLFile string `json:"CRLFile,omitempty"` //nolint:tagliatelle // correct from API
251251
DisabledProtocols string `json:"disabledProtocols,omitempty"`
252-
FIPSMode string `json:"FIPSMode,omitempty"` //nolint:tagliatelle // correct from API
252+
FIPSMode *bool `json:"FIPSMode,omitempty"` //nolint:tagliatelle // correct from API
253253
Mode string `json:"mode,omitempty"`
254254
PEMKeyFile string `json:"PEMKeyFile,omitempty"` //nolint:tagliatelle // correct from API
255255
}

opsmngr/automation_config_test.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ const jsonBlob = `{
7070
}, {
7171
"args2_6" : {
7272
"net" : {
73-
"port" : 27010
73+
"port" : 27010,
74+
"tls" : {
75+
"FIPSMode": true
76+
}
7477
},
7578
"replication" : {
7679
"replSetName" : "myReplicaSet"
@@ -190,6 +193,7 @@ func TestAutomation_GetConfig(t *testing.T) {
190193
}
191194

192195
slaveDelay := float64(0)
196+
fipsMode := true
193197
expected := &AutomationConfig{
194198
Auth: Auth{
195199
AutoAuthMechanism: "MONGODB-CR",
@@ -251,6 +255,7 @@ func TestAutomation_GetConfig(t *testing.T) {
251255
Args26: Args26{
252256
NET: Net{
253257
Port: 27010,
258+
TLS: &TLS{FIPSMode: &fipsMode},
254259
},
255260
Storage: &Storage{
256261
DBPath: "/data/rs2",

0 commit comments

Comments
 (0)