Skip to content

Commit 3fc0b93

Browse files
authored
CLOUDP-271187 Add support for 8.0 in localdev (#3221)
1 parent 770df13 commit 3fc0b93

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

internal/cli/deployments/setup.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"math/rand"
2222
"net"
2323
"os"
24+
"slices"
2425
"strconv"
2526
"strings"
2627
"time"
@@ -49,6 +50,7 @@ import (
4950
const (
5051
internalMongodPort = 27017
5152
mdb7 = "7.0"
53+
mdb8 = "8.0"
5254
defaultSettings = "default"
5355
customSettings = "custom"
5456
cancelSettings = "cancel"
@@ -95,7 +97,7 @@ var (
9597
options.CompassConnect: "MongoDB Compass",
9698
skipConnect: "Skip Connection",
9799
}
98-
mdbVersions = []string{mdb7}
100+
mdbVersions = []string{mdb7, mdb8}
99101
)
100102

101103
type SetupOpts struct {
@@ -413,7 +415,7 @@ func (opts *SetupOpts) validateFlags() error {
413415
}
414416
}
415417

416-
if opts.MdbVersion != "" && opts.MdbVersion != mdb7 {
418+
if opts.MdbVersion != "" && !slices.Contains(mdbVersions, opts.MdbVersion) {
417419
return fmt.Errorf("%w: %s", errInvalidMongoDBVersion, opts.MdbVersion)
418420
}
419421

@@ -452,7 +454,7 @@ func (opts *SetupOpts) setDefaultSettings() error {
452454
}
453455

454456
if opts.MdbVersion == "" {
455-
opts.MdbVersion = mdb7
457+
opts.MdbVersion = mdb8
456458
defaultValuesSet = true
457459
}
458460

internal/cli/deployments/setup_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func TestSetupOpts_LocalDev_HappyPathClean(t *testing.T) {
6363
force: true,
6464
}
6565

66-
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:7.0"
66+
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:8.0"
6767

6868
// Container engine is fine
6969
deploymentTest.MockContainerEngine.EXPECT().Ready().Return(nil).Times(1)
@@ -128,7 +128,7 @@ func TestSetupOpts_LocalDev_HappyPathOfflinePull(t *testing.T) {
128128
force: true,
129129
}
130130

131-
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:7.0"
131+
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:8.0"
132132

133133
// Container engine is fine
134134
deploymentTest.MockContainerEngine.EXPECT().Ready().Return(nil).Times(1)
@@ -196,7 +196,7 @@ func TestSetupOpts_LocalDev_UnhappyPathOfflinePull(t *testing.T) {
196196
force: true,
197197
}
198198

199-
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:7.0"
199+
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:8.0"
200200

201201
// Container engine is fine
202202
deploymentTest.MockContainerEngine.EXPECT().Ready().Return(nil).Times(1)
@@ -271,7 +271,7 @@ func TestSetupOpts_LocalDev_RemoveUnhealthyDeployment(t *testing.T) {
271271
force: true,
272272
}
273273

274-
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:7.0"
274+
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:8.0"
275275

276276
// Container engine is fine
277277
deploymentTest.MockContainerEngine.EXPECT().Ready().Return(nil).Times(1)

internal/podman/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
)
3030

3131
var (
32-
ErrPodmanNotFound = errors.New("podman not found in your system, check requirements at https://dochub.mongodb.org/core/atlas-cli-deploy-local-reqs")
32+
ErrPodmanNotFound = errors.New("neither docker or podman were found in your system, check requirements at https://dochub.mongodb.org/core/atlas-cli-deploy-local-reqs")
3333
ErrDeterminingPodmanVersion = errors.New("could not determine docker version")
3434
minPodmanVersion = semver.New(5, 0, 0, "", "") //nolint:mnd
3535
)

0 commit comments

Comments
 (0)