Skip to content

Commit 77e367e

Browse files
Removed defaultMongoDBVersion api call in builders. MongoDB version i… (#4054)
Co-authored-by: apix-bot[bot] <168195273+apix-bot[bot]@users.noreply.github.com>
1 parent 2b6741c commit 77e367e

File tree

1,348 files changed

+9775
-9732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,348 files changed

+9775
-9732
lines changed

docs/command/atlas-clusters-create.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ Options
9797
* - --mdbVersion
9898
- string
9999
- false
100-
- Major MongoDB version of the cluster.
100+
- Major MongoDB version of the cluster. When no value is specified, the latest stable MongoDB version is used, see: https://www.mongodb.com/resources/products/mongodb-version-history.
101101

102-
Mutually exclusive with --file. This value defaults to "8.0".
102+
Mutually exclusive with --file.
103103
* - -m, --members
104104
- int
105105
- false

internal/cli/clusters/create.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,11 @@ func (opts *CreateOpts) applyOptsAdvancedCluster(out *atlasClustersPinned.Advanc
332332

333333
if !opts.isTenant() {
334334
out.DiskSizeGB = &opts.diskSizeGB
335-
out.MongoDBMajorVersion = &opts.mdbVersion
335+
336+
// If no MongoDB version is specified, the backend uses the default MongoDB version
337+
if opts.mdbVersion != "" {
338+
out.MongoDBMajorVersion = &opts.mdbVersion
339+
}
336340
}
337341

338342
out.ReplicationSpecs = &[]atlasClustersPinned.ReplicationSpec{replicationSpec}
@@ -588,8 +592,6 @@ Deprecation note: the M2 and M5 tiers are now deprecated; when selecting M2 or M
588592
},
589593
}
590594

591-
currentMDBVersion, _ := cli.DefaultMongoDBMajorVersion()
592-
593595
const (
594596
defaultMembersSize = 3
595597
defaultDiskSize = 2
@@ -600,7 +602,7 @@ Deprecation note: the M2 and M5 tiers are now deprecated; when selecting M2 or M
600602
cmd.Flags().IntVarP(&opts.members, flag.Members, flag.MembersShort, defaultMembersSize, usage.Members)
601603
cmd.Flags().StringVar(&opts.tier, flag.Tier, atlasFlex, usage.Tier)
602604
cmd.Flags().Float64Var(&opts.diskSizeGB, flag.DiskSizeGB, defaultDiskSize, usage.DiskSizeGB)
603-
cmd.Flags().StringVar(&opts.mdbVersion, flag.MDBVersion, currentMDBVersion, usage.MDBVersion)
605+
cmd.Flags().StringVar(&opts.mdbVersion, flag.MDBVersion, "", usage.MDBVersionCreate)
604606
cmd.Flags().BoolVar(&opts.backup, flag.Backup, false, usage.Backup)
605607
cmd.Flags().BoolVar(&opts.biConnector, flag.BIConnector, false, usage.BIConnector)
606608
cmd.Flags().StringVarP(&opts.filename, flag.File, flag.FileShort, "", usage.ClusterFilename)

internal/usage/usage.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const (
3838
NExamples = "Maximum number of example queries to provide that a suggested index will improve."
3939
NIndexes = "Maximum number of indexes to suggest."
4040
MDBVersion = "Major MongoDB version of the cluster."
41+
MDBVersionCreate = "Major MongoDB version of the cluster. When no value is specified, the latest stable MongoDB version is used, see: https://www.mongodb.com/resources/products/mongodb-version-history."
4142
DeploymentMDBVersion = "Major MongoDB version of the deployment."
4243
AtlasAuthDB = "Authentication database name. If the user authenticates with AWS IAM, x.509, or LDAP, this value should be $external. If the user authenticates with SCRAM-SHA, this value should be admin."
4344
Granularity = "ISO 8601-formatted duration that specifies the interval between measurement data points. Only the following subset of ISO 8601-formatted time periods are supported: PT10S, PT1M, PT5M, PT1H, P1D. When you specify granularity, you must specify either period or start and end."

test/e2e/testdata/.snapshots/TestAccessList/Create_Delete_After/POST_api_atlas_v2_groups_687f1dd0a799aa2ae9e80b99_accessList_1.snaphost

Lines changed: 0 additions & 16 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
HTTP/2.0 201 Created
2+
Content-Length: 469
3+
Content-Type: application/vnd.atlas.2023-01-01+json;charset=utf-8
4+
Date: Thu, 24 Jul 2025 15:06:01 GMT
5+
Referrer-Policy: strict-origin-when-cross-origin
6+
Server: mdbws
7+
Strict-Transport-Security: max-age=31536000; includeSubdomains;
8+
X-Content-Type-Options: nosniff
9+
X-Envoy-Upstream-Service-Time: 139
10+
X-Frame-Options: DENY
11+
X-Java-Method: ApiAtlasNetworkAccessListResource::addAtlasWhitelist
12+
X-Java-Version: 17.0.15+6
13+
X-Mongodb-Service-Version: gitHash=8a5d994bc6bc5dc2c9f35e4a815f6c5f6b7e434b; versionString=master
14+
X-Permitted-Cross-Domain-Policies: none
15+
16+
{"links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68824bd5b4489810533462f2/accessList?includeCount=true&pageNum=1&itemsPerPage=100","rel":"self"}],"results":[{"cidrBlock":"192.168.0.55/32","comment":"test","deleteAfterDate":"2025-07-24T15:11:01Z","groupId":"68824bd5b4489810533462f2","ipAddress":"192.168.0.55","links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68824bd5b4489810533462f2/accessList/192.168.0.55%2F32","rel":"self"}]}],"totalCount":1}

test/e2e/testdata/.snapshots/TestAccessList/Create_Forever/POST_api_atlas_v2_groups_687f1dd0a799aa2ae9e80b99_accessList_1.snaphost

Lines changed: 0 additions & 16 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
HTTP/2.0 201 Created
2+
Content-Length: 428
3+
Content-Type: application/vnd.atlas.2023-01-01+json;charset=utf-8
4+
Date: Thu, 24 Jul 2025 15:06:00 GMT
5+
Referrer-Policy: strict-origin-when-cross-origin
6+
Server: mdbws
7+
Strict-Transport-Security: max-age=31536000; includeSubdomains;
8+
X-Content-Type-Options: nosniff
9+
X-Envoy-Upstream-Service-Time: 137
10+
X-Frame-Options: DENY
11+
X-Java-Method: ApiAtlasNetworkAccessListResource::addAtlasWhitelist
12+
X-Java-Version: 17.0.15+6
13+
X-Mongodb-Service-Version: gitHash=8a5d994bc6bc5dc2c9f35e4a815f6c5f6b7e434b; versionString=master
14+
X-Permitted-Cross-Domain-Policies: none
15+
16+
{"links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68824bd5b4489810533462f2/accessList?includeCount=true&pageNum=1&itemsPerPage=100","rel":"self"}],"results":[{"cidrBlock":"192.168.0.55/32","comment":"test","groupId":"68824bd5b4489810533462f2","ipAddress":"192.168.0.55","links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68824bd5b4489810533462f2/accessList/192.168.0.55%2F32","rel":"self"}]}],"totalCount":1}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
HTTP/2.0 200 OK
2-
Content-Length: 40
2+
Content-Length: 37
33
Content-Type: application/json
4-
Date: Tue, 22 Jul 2025 05:12:51 GMT
4+
Date: Thu, 24 Jul 2025 15:06:01 GMT
55
Referrer-Policy: strict-origin-when-cross-origin
66
Server: mdbws
77
Strict-Transport-Security: max-age=31536000; includeSubdomains;
88
X-Content-Type-Options: nosniff
99
X-Frame-Options: DENY
1010
X-Java-Method: ApiPrivateIpInfoResource::getIpInfo
1111
X-Java-Version: 17.0.15+6
12-
X-Mongodb-Service-Version: gitHash=bb9e79411fd875014d78a71092d09e70eba48244; versionString=master
12+
X-Mongodb-Service-Version: gitHash=8a5d994bc6bc5dc2c9f35e4a815f6c5f6b7e434b; versionString=master
1313
X-Permitted-Cross-Domain-Policies: none
1414
X-Xgen-Up-Proto: HTTP/2
1515

16-
{"currentIpv4Address":"172.174.166.194"}
16+
{"currentIpv4Address":"4.236.159.84"}

test/e2e/testdata/.snapshots/TestAccessList/Create_with_CurrentIp/POST_api_atlas_v2_groups_687f1dd0a799aa2ae9e80b99_accessList_1.snaphost

Lines changed: 0 additions & 16 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
HTTP/2.0 201 Created
2+
Content-Length: 428
3+
Content-Type: application/vnd.atlas.2023-01-01+json;charset=utf-8
4+
Date: Thu, 24 Jul 2025 15:06:01 GMT
5+
Referrer-Policy: strict-origin-when-cross-origin
6+
Server: mdbws
7+
Strict-Transport-Security: max-age=31536000; includeSubdomains;
8+
X-Content-Type-Options: nosniff
9+
X-Envoy-Upstream-Service-Time: 118
10+
X-Frame-Options: DENY
11+
X-Java-Method: ApiAtlasNetworkAccessListResource::addAtlasWhitelist
12+
X-Java-Version: 17.0.15+6
13+
X-Mongodb-Service-Version: gitHash=8a5d994bc6bc5dc2c9f35e4a815f6c5f6b7e434b; versionString=master
14+
X-Permitted-Cross-Domain-Policies: none
15+
16+
{"links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68824bd5b4489810533462f2/accessList?includeCount=true&pageNum=1&itemsPerPage=100","rel":"self"}],"results":[{"cidrBlock":"4.236.159.84/32","comment":"test","groupId":"68824bd5b4489810533462f2","ipAddress":"4.236.159.84","links":[{"href":"http://localhost:8080/api/atlas/v2/groups/68824bd5b4489810533462f2/accessList/4.236.159.84%2F32","rel":"self"}]}],"totalCount":1}

0 commit comments

Comments
 (0)