Skip to content

Commit

Permalink
feat: added parameter versionReleaseSystem in clusters (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
coderGo93 committed Nov 30, 2021
1 parent 4cf823b commit cb00594
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
1 change: 1 addition & 0 deletions mongodbatlas/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
45 changes: 28 additions & 17 deletions mongodbatlas/clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 := `
Expand Down Expand Up @@ -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"
}
`

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 := `
Expand Down Expand Up @@ -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"
}
`

Expand Down Expand Up @@ -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"
}`)
})

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit cb00594

Please sign in to comment.