Skip to content

Commit cb00594

Browse files
authored
feat: added parameter versionReleaseSystem in clusters (#270)
1 parent 4cf823b commit cb00594

File tree

2 files changed

+29
-17
lines changed

2 files changed

+29
-17
lines changed

mongodbatlas/clusters.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ type Cluster struct {
166166
StateName string `json:"stateName,omitempty"`
167167
ConnectionStrings *ConnectionStrings `json:"connectionStrings,omitempty"`
168168
Links []*Link `json:"links,omitempty"`
169+
VersionReleaseSystem string `json:"versionReleaseSystem,omitempty"`
169170
}
170171

171172
// ProcessArgs represents the advanced configuration options for the cluster.

mongodbatlas/clusters_test.go

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ func TestClusters_ListClusters(t *testing.T) {
104104
}
105105
},
106106
"srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
107-
"stateName": "IDLE"
107+
"stateName": "IDLE",
108+
"versionReleaseSystem": "LTS"
108109
},
109110
{
110111
"autoScaling": {
@@ -178,7 +179,8 @@ func TestClusters_ListClusters(t *testing.T) {
178179
}
179180
},
180181
"srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
181-
"stateName": "IDLE"
182+
"stateName": "IDLE",
183+
"versionReleaseSystem": "LTS"
182184
}
183185
],
184186
"totalCount": 2
@@ -256,8 +258,9 @@ func TestClusters_ListClusters(t *testing.T) {
256258
ReadOnlyNodes: pointy.Int64(0),
257259
},
258260
},
259-
SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
260-
StateName: "IDLE",
261+
SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
262+
StateName: "IDLE",
263+
VersionReleaseSystem: "LTS",
261264
}
262265

263266
expected := []Cluster{cluster1, cluster1}
@@ -384,8 +387,9 @@ func TestClusters_Create(t *testing.T) {
384387
ReadOnlyNodes: pointy.Int64(0),
385388
},
386389
},
387-
SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
388-
StateName: "IDLE",
390+
SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
391+
StateName: "IDLE",
392+
VersionReleaseSystem: "LTS",
389393
}
390394

391395
mux.HandleFunc(fmt.Sprintf("/api/atlas/v1.0/groups/%s/clusters", groupID), func(w http.ResponseWriter, r *http.Request) {
@@ -435,8 +439,9 @@ func TestClusters_Create(t *testing.T) {
435439
"readOnlyNodes": float64(0),
436440
},
437441
},
438-
"srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
439-
"stateName": "IDLE",
442+
"srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
443+
"stateName": "IDLE",
444+
"versionReleaseSystem": "LTS",
440445
}
441446

442447
jsonBlob := `
@@ -488,7 +493,8 @@ func TestClusters_Create(t *testing.T) {
488493
}
489494
},
490495
"srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
491-
"stateName": "IDLE"
496+
"stateName": "IDLE",
497+
"versionReleaseSystem": "LTS"
492498
}
493499
`
494500

@@ -565,8 +571,9 @@ func TestClusters_Update(t *testing.T) {
565571
ReadOnlyNodes: pointy.Int64(0),
566572
},
567573
},
568-
SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
569-
StateName: "IDLE",
574+
SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
575+
StateName: "IDLE",
576+
VersionReleaseSystem: "LTS",
570577
}
571578

572579
mux.HandleFunc(fmt.Sprintf("/api/atlas/v1.0/groups/%s/clusters/%s", groupID, clusterName), func(w http.ResponseWriter, r *http.Request) {
@@ -616,8 +623,9 @@ func TestClusters_Update(t *testing.T) {
616623
"readOnlyNodes": float64(0),
617624
},
618625
},
619-
"srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
620-
"stateName": "IDLE",
626+
"srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
627+
"stateName": "IDLE",
628+
"versionReleaseSystem": "LTS",
621629
}
622630

623631
jsonBlob := `
@@ -668,7 +676,8 @@ func TestClusters_Update(t *testing.T) {
668676
}
669677
},
670678
"srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
671-
"stateName": "IDLE"
679+
"stateName": "IDLE",
680+
"versionReleaseSystem": "LTS"
672681
}
673682
`
674683

@@ -917,7 +926,8 @@ func TestClusters_Get(t *testing.T) {
917926
}
918927
},
919928
"srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
920-
"stateName": "IDLE"
929+
"stateName": "IDLE",
930+
"versionReleaseSystem": "LTS"
921931
}`)
922932
})
923933

@@ -981,8 +991,9 @@ func TestClusters_Get(t *testing.T) {
981991
ReadOnlyNodes: pointy.Int64(0),
982992
},
983993
},
984-
SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
985-
StateName: "IDLE",
994+
SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017",
995+
StateName: "IDLE",
996+
VersionReleaseSystem: "LTS",
986997
}
987998

988999
if diff := deep.Equal(cluster, expected); diff != nil {

0 commit comments

Comments
 (0)