File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
internal/cli/atlas/deployments Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ package deployments
17
17
import (
18
18
"context"
19
19
"errors"
20
+ "fmt"
20
21
21
22
"github.com/mongodb/mongodb-atlas-cli/internal/cli"
22
23
"github.com/mongodb/mongodb-atlas-cli/internal/cli/atlas/deployments/options"
@@ -47,6 +48,7 @@ const listTemplate = `NAME TYPE MDB VER STATE
47
48
{{end}}`
48
49
49
50
const MaxItemsPerPage = 500
51
+ const errAtlas = "failed to retrieve Atlas deployments with: %s"
50
52
51
53
func (opts * ListOpts ) initStore (ctx context.Context ) func () error {
52
54
return func () error {
@@ -102,21 +104,22 @@ func (opts *ListOpts) getAtlasDeployments() ([]options.Deployment, error) {
102
104
}
103
105
104
106
func (opts * ListOpts ) Run (ctx context.Context ) error {
105
- atlasClusters , err := opts .getAtlasDeployments ()
106
- if err != nil {
107
- return err
108
- }
109
-
110
107
mdbContainers , err := opts .GetLocalDeployments (ctx )
111
108
if err != nil && ! errors .Is (err , podman .ErrPodmanNotFound ) {
112
109
return err
113
110
}
114
111
112
+ atlasClusters , atlasErr := opts .getAtlasDeployments ()
113
+
115
114
err = opts .Print (append (atlasClusters , mdbContainers ... ))
116
115
if err != nil {
117
116
return err
118
117
}
119
118
119
+ if atlasErr != nil {
120
+ return fmt .Errorf (errAtlas , atlasErr .Error ())
121
+ }
122
+
120
123
return nil
121
124
}
122
125
You can’t perform that action at this time.
0 commit comments