Skip to content

Commit bf141bd

Browse files
committed
address comments
1 parent 308bd76 commit bf141bd

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

internal/cli/deployments/options/deployment_opts.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ import (
2121
"io"
2222
"regexp"
2323
"sort"
24+
"strconv"
2425
"strings"
2526
"time"
2627

2728
"github.com/AlecAivazis/survey/v2"
29+
"github.com/Masterminds/semver/v3"
2830
"github.com/briandowns/spinner"
2931
"github.com/mongodb/atlas-cli-core/config"
3032
"github.com/mongodb/mongodb-atlas-cli/atlascli/internal/cli"
@@ -156,7 +158,8 @@ func getLocalDevImage() string {
156158
}
157159

158160
func (opts *DeploymentOpts) MongodDockerImageName() string {
159-
return getLocalDevImage() + ":" + opts.MdbVersion
161+
v, _ := semver.NewVersion(opts.MdbVersion)
162+
return getLocalDevImage() + ":" + strconv.FormatUint(v.Major(), 10)
160163
}
161164

162165
func (opts *DeploymentOpts) Spin(funcs ...func() error) error {

internal/cli/deployments/setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import (
5353
const (
5454
internalMongodPort = 27017
5555
mdb7 = "7.0"
56-
mdb8 = "8.2"
56+
mdb8 = "8.0"
5757
defaultSettings = "default"
5858
customSettings = "custom"
5959
cancelSettings = "cancel"

internal/cli/deployments/setup_test.go

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

68-
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:8.2"
68+
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:8"
6969

7070
// Container engine is fine
7171
deploymentTest.MockContainerEngine.EXPECT().Ready().Return(nil).Times(1)
@@ -130,7 +130,7 @@ func TestSetupOpts_LocalDev_HappyPathOfflinePull(t *testing.T) {
130130
force: true,
131131
}
132132

133-
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:8.2"
133+
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:8"
134134

135135
// Container engine is fine
136136
deploymentTest.MockContainerEngine.EXPECT().Ready().Return(nil).Times(1)
@@ -198,7 +198,7 @@ func TestSetupOpts_LocalDev_UnhappyPathOfflinePull(t *testing.T) {
198198
force: true,
199199
}
200200

201-
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:8.2"
201+
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:8"
202202

203203
// Container engine is fine
204204
deploymentTest.MockContainerEngine.EXPECT().Ready().Return(nil).Times(1)
@@ -274,7 +274,7 @@ func TestSetupOpts_LocalDev_RemoveUnhealthyDeployment(t *testing.T) {
274274
force: true,
275275
}
276276

277-
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:8.2"
277+
const dockerImageName = "docker.io/mongodb/mongodb-atlas-local:8"
278278

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

0 commit comments

Comments
 (0)