From cb00594ec51e290c3eb5b944118229655bcfee7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20L=C3=B3pez?= Date: Tue, 30 Nov 2021 02:35:52 -0700 Subject: [PATCH] feat: added parameter versionReleaseSystem in clusters (#270) --- mongodbatlas/clusters.go | 1 + mongodbatlas/clusters_test.go | 45 ++++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/mongodbatlas/clusters.go b/mongodbatlas/clusters.go index fb8315e60..ed85a07ce 100644 --- a/mongodbatlas/clusters.go +++ b/mongodbatlas/clusters.go @@ -166,6 +166,7 @@ type Cluster struct { StateName string `json:"stateName,omitempty"` ConnectionStrings *ConnectionStrings `json:"connectionStrings,omitempty"` Links []*Link `json:"links,omitempty"` + VersionReleaseSystem string `json:"versionReleaseSystem,omitempty"` } // ProcessArgs represents the advanced configuration options for the cluster. diff --git a/mongodbatlas/clusters_test.go b/mongodbatlas/clusters_test.go index 573398f90..46210bce1 100644 --- a/mongodbatlas/clusters_test.go +++ b/mongodbatlas/clusters_test.go @@ -104,7 +104,8 @@ func TestClusters_ListClusters(t *testing.T) { } }, "srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", - "stateName": "IDLE" + "stateName": "IDLE", + "versionReleaseSystem": "LTS" }, { "autoScaling": { @@ -178,7 +179,8 @@ func TestClusters_ListClusters(t *testing.T) { } }, "srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", - "stateName": "IDLE" + "stateName": "IDLE", + "versionReleaseSystem": "LTS" } ], "totalCount": 2 @@ -256,8 +258,9 @@ func TestClusters_ListClusters(t *testing.T) { ReadOnlyNodes: pointy.Int64(0), }, }, - SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", - StateName: "IDLE", + SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", + StateName: "IDLE", + VersionReleaseSystem: "LTS", } expected := []Cluster{cluster1, cluster1} @@ -384,8 +387,9 @@ func TestClusters_Create(t *testing.T) { ReadOnlyNodes: pointy.Int64(0), }, }, - SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", - StateName: "IDLE", + SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", + StateName: "IDLE", + VersionReleaseSystem: "LTS", } 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) { "readOnlyNodes": float64(0), }, }, - "srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", - "stateName": "IDLE", + "srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", + "stateName": "IDLE", + "versionReleaseSystem": "LTS", } jsonBlob := ` @@ -488,7 +493,8 @@ func TestClusters_Create(t *testing.T) { } }, "srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", - "stateName": "IDLE" + "stateName": "IDLE", + "versionReleaseSystem": "LTS" } ` @@ -565,8 +571,9 @@ func TestClusters_Update(t *testing.T) { ReadOnlyNodes: pointy.Int64(0), }, }, - SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", - StateName: "IDLE", + SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", + StateName: "IDLE", + VersionReleaseSystem: "LTS", } 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) { "readOnlyNodes": float64(0), }, }, - "srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", - "stateName": "IDLE", + "srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", + "stateName": "IDLE", + "versionReleaseSystem": "LTS", } jsonBlob := ` @@ -668,7 +676,8 @@ func TestClusters_Update(t *testing.T) { } }, "srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", - "stateName": "IDLE" + "stateName": "IDLE", + "versionReleaseSystem": "LTS" } ` @@ -917,7 +926,8 @@ func TestClusters_Get(t *testing.T) { } }, "srvAddress": "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", - "stateName": "IDLE" + "stateName": "IDLE", + "versionReleaseSystem": "LTS" }`) }) @@ -981,8 +991,9 @@ func TestClusters_Get(t *testing.T) { ReadOnlyNodes: pointy.Int64(0), }, }, - SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", - StateName: "IDLE", + SrvAddress: "mongodb+srv://mongo-shard-00-00.mongodb.net:27017,mongo-shard-00-01.mongodb.net:27017,mongo-shard-00-02.mongodb.net:27017", + StateName: "IDLE", + VersionReleaseSystem: "LTS", } if diff := deep.Equal(cluster, expected); diff != nil {