diff --git a/docs/atlascli/command/atlas-deployments-delete.txt b/docs/atlascli/command/atlas-deployments-delete.txt index 6ae162f96f..b00edf7179 100644 --- a/docs/atlascli/command/atlas-deployments-delete.txt +++ b/docs/atlascli/command/atlas-deployments-delete.txt @@ -14,6 +14,13 @@ atlas deployments delete Delete a deployment. +The command prompts you to confirm the operation when you run the command without the --force option. + +Deleting an Atlas deployment also deletes any backup snapshots for that cluster. +Deleting a Local deployment also deletes any local data volumes. + +To use this command, you must authenticate with a user account or an API key that has the Project Owner role. + Syntax ------ @@ -59,6 +66,22 @@ Options - - false - help for delete + * - --projectId + - string + - false + - Hexadecimal string that identifies the project to use. This option overrides the settings in the configuration file or environment variable. + * - --type + - string + - false + - Type of deployment that you want to create. Valid values are ATLAS or LOCAL. + * - -w, --watch + - + - false + - Watch the command until it completes its execution or the watch times out. To set the time that the watch times out, use the --watchTimeout option. + * - --watchTimeout + - uint + - false + - Time in seconds until a watch times out. After a watch times out, the CLI no longer watches the command. Inherited Options ----------------- @@ -86,3 +109,22 @@ If the command succeeds, the CLI returns output similar to the following sample. Deployment '' deleted +Examples +-------- + +.. code-block:: + + # Remove an Atlas deployment named myDeployment after prompting for a confirmation: + atlas deployments delete myDeployment --type ATLAS + + +.. code-block:: + + # Remove an Atlas deployment named myDeployment without requiring confirmation: + atlas deployments delete myDeployment --type ATLAS --force + + +.. code-block:: + + # Remove an Local deployment named myDeployment without requiring confirmation: + atlas deployments delete myDeployment --type LOCAL --force diff --git a/go.mod b/go.mod index e7403788a6..ce7d052fe7 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/kms v1.24.5 github.com/briandowns/spinner v1.23.0 github.com/containers/common v0.56.0 - github.com/containers/podman/v4 v4.6.2 + github.com/containers/podman/v4 v4.7.0 github.com/creack/pty v1.1.18 github.com/denisbrodbeck/machineid v1.0.1 github.com/evergreen-ci/shrub v0.0.0-20230905131908-6b01f04bb1d2 @@ -95,7 +95,7 @@ require ( github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect github.com/containers/ocicrypt v1.1.8 // indirect github.com/containers/storage v1.50.2 // indirect - github.com/coreos/stream-metadata-go v0.4.2 // indirect + github.com/coreos/stream-metadata-go v0.4.3 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/docker/docker v24.0.6+incompatible // indirect @@ -147,9 +147,9 @@ require ( github.com/montanaflynn/stats v0.7.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc4 // indirect + github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/opencontainers/runc v1.1.9 // indirect - github.com/opencontainers/runtime-spec v1.1.0 // indirect + github.com/opencontainers/runtime-spec v1.1.1-0.20230823135140-4fec88fd00a4 // indirect github.com/opencontainers/selinux v1.11.0 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pkg/errors v0.9.1 // indirect diff --git a/go.sum b/go.sum index 4e584987fc..e19716e9be 100644 --- a/go.sum +++ b/go.sum @@ -152,12 +152,12 @@ github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYgle github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY= github.com/containers/ocicrypt v1.1.8 h1:saSBF0/8DyPUjzcxMVzL2OBUWCkvRvqIm75pu0ADSZk= github.com/containers/ocicrypt v1.1.8/go.mod h1:jM362hyBtbwLMWzXQZTlkjKGAQf/BN/LFMtH0FIRt34= -github.com/containers/podman/v4 v4.6.2 h1:tUHH6RfavqH0QZJHA9JoiMtMatjUSe4LjkvQYD8AhMs= -github.com/containers/podman/v4 v4.6.2/go.mod h1:RszjaonNv/hLayX58T06xci2ixrcCoR5hfdfN6PQWmc= +github.com/containers/podman/v4 v4.7.0 h1:KjawmmazJHyQfck5sFLzQ/KI+JtsnnoGI+d+qfiPvaY= +github.com/containers/podman/v4 v4.7.0/go.mod h1:FJPqIhiwdklJenJskZyoNd1ZNin6kvY6zL9Rypaajxs= github.com/containers/storage v1.50.2 h1:Fys4BjFUVNRBEXlO70hFI48VW4EXsgnGisTpk9tTMsE= github.com/containers/storage v1.50.2/go.mod h1:dpspZsUrcKD8SpTofvKWhwPDHD0MkO4Q7VE+oYdWkiA= -github.com/coreos/stream-metadata-go v0.4.2 h1:A0Ug0Ecb6mlJ5X/tXpBZgZJsA/Ulhj1BR0rEZJMzN4I= -github.com/coreos/stream-metadata-go v0.4.2/go.mod h1:fMObQqQm8Ku91G04btKzEH3AsdP1mrAb986z9aaK0tE= +github.com/coreos/stream-metadata-go v0.4.3 h1:5GykJ8dtZSx1rdlzEAiDVzA73cwmUF3ceTuIP293L6E= +github.com/coreos/stream-metadata-go v0.4.3/go.mod h1:fMObQqQm8Ku91G04btKzEH3AsdP1mrAb986z9aaK0tE= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -425,12 +425,12 @@ github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc4 h1:oOxKUJWnFC4YGHCCMNql1x4YaDfYBTS5Y4x/Cgeo1E0= -github.com/opencontainers/image-spec v1.1.0-rc4/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= +github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= +github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/runc v1.1.9 h1:XR0VIHTGce5eWPkaPesqTBrhW2yAcaraWfsEalNwQLM= github.com/opencontainers/runc v1.1.9/go.mod h1:CbUumNnWCuTGFukNXahoo/RFBZvDAgRh/smNYNOhA50= -github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= -github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.1.1-0.20230823135140-4fec88fd00a4 h1:EctkgBjZ1y4q+sibyuuIgiKpa0QSd2elFtSSdNvBVow= +github.com/opencontainers/runtime-spec v1.1.1-0.20230823135140-4fec88fd00a4/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU= github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= diff --git a/internal/cli/atlas/deployments/delete.go b/internal/cli/atlas/deployments/delete.go index fa133f3c1c..583249f54b 100644 --- a/internal/cli/atlas/deployments/delete.go +++ b/internal/cli/atlas/deployments/delete.go @@ -16,47 +16,104 @@ package deployments import ( "context" + "fmt" + "time" "github.com/mongodb/mongodb-atlas-cli/internal/cli" "github.com/mongodb/mongodb-atlas-cli/internal/cli/atlas/deployments/options" "github.com/mongodb/mongodb-atlas-cli/internal/cli/require" + "github.com/mongodb/mongodb-atlas-cli/internal/config" "github.com/mongodb/mongodb-atlas-cli/internal/flag" "github.com/mongodb/mongodb-atlas-cli/internal/log" "github.com/mongodb/mongodb-atlas-cli/internal/podman" + "github.com/mongodb/mongodb-atlas-cli/internal/store" "github.com/mongodb/mongodb-atlas-cli/internal/telemetry" "github.com/mongodb/mongodb-atlas-cli/internal/usage" + "github.com/mongodb/mongodb-atlas-cli/internal/watchers" "github.com/spf13/cobra" ) +const ( + deleteSuccessMessage = "Deployment '%s' deleted\n" + deleteFailMessage = "Deployment not deleted" +) + type DeleteOpts struct { cli.OutputOpts cli.GlobalOpts *cli.DeleteOpts + cli.WatchOpts options.DeploymentOpts - podmanClient podman.Client + atlasStore store.ClusterDeleter +} + +func (opts *DeleteOpts) initAtlasStore(ctx context.Context) func() error { + return func() error { + var err error + opts.atlasStore, err = store.New(store.AuthenticatedPreset(config.Default()), store.WithContext(ctx)) + return err + } } func (opts *DeleteOpts) Run(ctx context.Context) error { - if err := opts.LocalDeploymentPreRun(ctx); err != nil { + if err := opts.validateAndPrompt(ctx); err != nil { + return err + } + opts.Entry = opts.DeploymentName + + if err := opts.Prompt(); err != nil { return err } - if err := opts.podmanClient.Ready(ctx); err != nil { + if opts.IsAtlasDeploymentType() { + return opts.runAtlas() + } + return opts.runLocal(ctx) +} + +func (opts *DeleteOpts) validateAndPrompt(ctx context.Context) error { + if err := opts.ValidateAndPromptDeploymentType(); err != nil { + return err + } + telemetry.AppendOption(telemetry.WithDeploymentType(options.LocalCluster)) + + if opts.IsAtlasDeploymentType() { + return opts.validateAndPromptAtlas() + } + return opts.validateAndPromptLocal(ctx) +} + +func (opts *DeleteOpts) validateAndPromptAtlas() error { + if opts.DeploymentName == "" { + return ErrNoDeploymentName + } + + return opts.ValidateProjectID() +} + +func (opts *DeleteOpts) validateAndPromptLocal(ctx context.Context) error { + if err := opts.PodmanClient.Ready(ctx); err != nil { return err } - telemetry.AppendOption(telemetry.WithDeploymentType(options.LocalCluster)) // always local if opts.DeploymentName == "" { if err := opts.DeploymentOpts.Select(ctx); err != nil { return err } } - opts.Entry = opts.DeploymentName - if err := opts.Prompt(); err != nil { + return nil +} + +func (opts *DeleteOpts) runAtlas() error { + return opts.Delete(opts.atlasStore.DeleteCluster, opts.ConfigProjectID()) +} + +func (opts *DeleteOpts) runLocal(ctx context.Context) error { + err := opts.LocalDeploymentPreRun(ctx) + if err != nil { return err } - return opts.Delete(func() error { _, _ = log.Warningln("deleting deployment...") opts.StartSpinner() @@ -65,16 +122,52 @@ func (opts *DeleteOpts) Run(ctx context.Context) error { }) } +func (opts *DeleteOpts) PostRun() error { + if !opts.EnableWatch || !opts.IsAtlasDeploymentType() { + return nil + } + + watcher := watchers.NewWatcher( + *watchers.ClusterDeleted, + watchers.NewAtlasClusterStateDescriber( + opts.atlasStore.(store.AtlasClusterDescriber), + opts.ProjectID, + opts.Entry, + ), + ) + + watcher.Timeout = time.Duration(opts.Timeout) + if err := opts.WatchWatcher(watcher); err != nil { + return err + } + + return opts.Print(nil) +} + // atlas deployments delete . func DeleteBuilder() *cobra.Command { opts := &DeleteOpts{ - DeleteOpts: cli.NewDeleteOpts("Deployment '%s' deleted\n", "Deployment not deleted"), + DeleteOpts: cli.NewDeleteOpts(deleteSuccessMessage, deleteFailMessage), } cmd := &cobra.Command{ - Use: "delete [deploymentName]", - Short: "Delete a deployment.", + Use: "delete [deploymentName]", + Short: "Delete a deployment.", + Long: `The command prompts you to confirm the operation when you run the command without the --force option. + +Deleting an Atlas deployment also deletes any backup snapshots for that cluster. +Deleting a Local deployment also deletes any local data volumes. + +` + fmt.Sprintf(usage.RequiredRole, "Project Owner"), + Example: fmt.Sprintf(` # Remove an Atlas deployment named myDeployment after prompting for a confirmation: + %[1]s deployments delete myDeployment --type ATLAS + + # Remove an Atlas deployment named myDeployment without requiring confirmation: + %[1]s deployments delete myDeployment --type ATLAS --force + + # Remove an Local deployment named myDeployment without requiring confirmation: + %[1]s deployments delete myDeployment --type LOCAL --force`, cli.ExampleAtlasEntryPoint()), Aliases: []string{"rm"}, - GroupID: "local", + GroupID: "all", Args: require.MaximumNArgs(1), Annotations: map[string]string{ "deploymentNameDesc": "Name of the deployment that you want to delete.", @@ -84,15 +177,27 @@ func DeleteBuilder() *cobra.Command { if len(args) == 1 { opts.DeploymentName = args[0] } - opts.podmanClient = podman.NewClient(log.IsDebugLevel(), log.Writer()) - return opts.PreRunE(opts.InitOutput(cmd.OutOrStdout(), ""), opts.InitStore(opts.podmanClient)) + opts.PodmanClient = podman.NewClient(log.IsDebugLevel(), log.Writer()) + return opts.PreRunE( + opts.initAtlasStore(cmd.Context()), + opts.InitOutput(cmd.OutOrStdout(), ""), + opts.InitStore(opts.PodmanClient), + ) }, RunE: func(cmd *cobra.Command, args []string) error { return opts.Run(cmd.Context()) }, + PostRunE: func(cmd *cobra.Command, args []string) error { + return opts.PostRun() + }, } + cmd.Flags().StringVar(&opts.DeploymentType, flag.TypeFlag, "", usage.DeploymentType) cmd.Flags().BoolVar(&opts.Confirm, flag.Force, false, usage.Force) + cmd.Flags().BoolVarP(&opts.EnableWatch, flag.EnableWatch, flag.EnableWatchShort, false, usage.EnableWatch) + cmd.Flags().UintVar(&opts.Timeout, flag.WatchTimeout, 0, usage.WatchTimeout) + + cmd.Flags().StringVar(&opts.ProjectID, flag.ProjectID, "", usage.ProjectID) return cmd } diff --git a/internal/cli/atlas/deployments/delete_test.go b/internal/cli/atlas/deployments/delete_test.go new file mode 100644 index 0000000000..872ef412a1 --- /dev/null +++ b/internal/cli/atlas/deployments/delete_test.go @@ -0,0 +1,164 @@ +// Copyright 2023 MongoDB Inc +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build unit + +package deployments + +import ( + "bytes" + "context" + "testing" + + "github.com/containers/podman/v4/libpod/define" + "github.com/golang/mock/gomock" + "github.com/mongodb/mongodb-atlas-cli/internal/cli" + "github.com/mongodb/mongodb-atlas-cli/internal/cli/atlas/deployments/options" + "github.com/mongodb/mongodb-atlas-cli/internal/flag" + "github.com/mongodb/mongodb-atlas-cli/internal/mocks" + "github.com/mongodb/mongodb-atlas-cli/internal/test" +) + +func TestDelete_Run_Atlas(t *testing.T) { + ctrl := gomock.NewController(t) + mockAtlasStore := mocks.NewMockClusterDeleter(ctrl) + mockCredentialsGetter := mocks.NewMockCredentialsGetter(ctrl) + ctx := context.Background() + + buf := new(bytes.Buffer) + opts := &DeleteOpts{ + atlasStore: mockAtlasStore, + DeploymentOpts: options.DeploymentOpts{ + CredStore: mockCredentialsGetter, + DeploymentName: "testDeployment", + DeploymentType: "atlas", + }, + GlobalOpts: cli.GlobalOpts{ + ProjectID: "64f670f0bf789926667dad1a", + }, + OutputOpts: cli.OutputOpts{ + OutWriter: buf, + }, + DeleteOpts: cli.NewDeleteOpts(deleteSuccessMessage, deleteFailMessage), + } + opts.Confirm = true + + mockAtlasStore. + EXPECT(). + DeleteCluster(opts.ProjectID, opts.DeploymentName). + Return(nil). + Times(1) + + if err := opts.Run(ctx); err != nil { + t.Fatalf("Run() unexpected error: %v", err) + } + + t.Log(buf.String()) +} + +func TestDelete_Run_Local(t *testing.T) { + ctrl := gomock.NewController(t) + mockPodman := mocks.NewMockClient(ctrl) + ctx := context.Background() + buf := new(bytes.Buffer) + + expectedLocalDeployment := "testDeployment" + opts := &DeleteOpts{ + DeploymentOpts: options.DeploymentOpts{ + PodmanClient: mockPodman, + DeploymentName: expectedLocalDeployment, + DeploymentType: "local", + }, + GlobalOpts: cli.GlobalOpts{ + ProjectID: "64f670f0bf789926667dad1a", + }, + OutputOpts: cli.OutputOpts{ + OutWriter: buf, + }, + DeleteOpts: cli.NewDeleteOpts(deleteSuccessMessage, deleteFailMessage), + } + opts.Confirm = true + + mockPodman. + EXPECT(). + Ready(ctx). + Return(nil). + Times(1) + + mockPodman. + EXPECT(). + RemoveContainers(ctx, options.MongodHostnamePrefix+"-"+expectedLocalDeployment). + Return(nil, nil). + Times(1) + + mockPodman. + EXPECT(). + RemoveNetworks(ctx, "mdb-local-"+expectedLocalDeployment). + Return(nil, nil). + Times(1) + + mockPodman. + EXPECT(). + RemoveVolumes(ctx, + "mongod-local-data-"+expectedLocalDeployment, + "mongot-local-data-"+expectedLocalDeployment, + "mongot-local-metrics-"+expectedLocalDeployment, + ). + Return(nil, nil). + Times(1) + + mockPodman. + EXPECT(). + ContainerInspect(ctx, options.MongodHostnamePrefix+"-"+expectedLocalDeployment). + Return([]*define.InspectContainerData{ + { + Name: options.MongodHostnamePrefix + "-" + expectedLocalDeployment, + Config: &define.InspectContainerConfig{ + Labels: map[string]string{ + "version": "7.0.1", + }, + }, + HostConfig: &define.InspectContainerHostConfig{ + PortBindings: map[string][]define.InspectHostPort{ + "27017/tcp": { + { + HostIP: "127.0.0.1", + HostPort: "27017", + }, + }, + }, + }, + Mounts: []define.InspectMount{ + { + Name: "mongod-local-data-" + expectedLocalDeployment, + }, + }, + }, + }, nil). + Times(1) + + if err := opts.Run(ctx); err != nil { + t.Fatalf("Run() unexpected error: %v", err) + } + + t.Log(buf.String()) +} +func TestDeleteBuilder(t *testing.T) { + test.CmdValidator( + t, + DeleteBuilder(), + 0, + []string{flag.TypeFlag, flag.Force, flag.EnableWatch, flag.WatchTimeout, flag.ProjectID}, + ) +} diff --git a/internal/store/store.go b/internal/store/store.go index 422b704b01..db033c758f 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -132,9 +132,6 @@ func customCATransport(ca []byte) *http.Transport { } func (s *Store) httpClient(httpTransport http.RoundTripper) (*http.Client, error) { - if s.username == "" && s.password == "" && s.accessToken == nil { - return &http.Client{Transport: httpTransport}, nil - } if s.username != "" && s.password != "" { t := &digest.Transport{ Username: s.username, @@ -143,12 +140,16 @@ func (s *Store) httpClient(httpTransport http.RoundTripper) (*http.Client, error t.Transport = httpTransport return t.Client() } - tr := &Transport{ - token: s.accessToken, - base: httpTransport, + if s.accessToken != nil { + tr := &Transport{ + token: s.accessToken, + base: httpTransport, + } + + return &http.Client{Transport: tr}, nil } - return &http.Client{Transport: tr}, nil + return &http.Client{Transport: httpTransport}, nil } type Transport struct { diff --git a/test/e2e/atlas/deployments_atlas_test.go b/test/e2e/atlas/deployments_atlas_test.go index b7ac5292e8..18001d6cc6 100644 --- a/test/e2e/atlas/deployments_atlas_test.go +++ b/test/e2e/atlas/deployments_atlas_test.go @@ -199,20 +199,23 @@ func TestDeploymentsAtlas(t *testing.T) { a.Contains(out, "Search index created") }) - // TODO: Update with deployments delete CLOUDP-199629 t.Run("Delete Cluster", func(t *testing.T) { cmd := exec.Command(cliPath, - clustersEntity, + deploymentEntity, "delete", clusterName, + "--type", + "ATLAS", "--force", + "--watch", + "--watchTimeout", "300", "--projectId", g.projectID, ) cmd.Env = os.Environ() resp, err := cmd.CombinedOutput() req.NoError(err, string(resp)) - expected := fmt.Sprintf("Deleting cluster '%s'", clusterName) + expected := fmt.Sprintf("Deployment '" + clusterName + "' deleted\n\n") assert.Equal(t, expected, string(resp)) }) @@ -229,5 +232,4 @@ func TestDeploymentsAtlas(t *testing.T) { resp, _ := cmd.CombinedOutput() t.Log(string(resp)) }) - // TODO: Add support for connect CLOUDP-199422 } diff --git a/test/e2e/atlas/deployments_local_test.go b/test/e2e/atlas/deployments_local_test.go index 1bfd9db40f..985b31af8f 100644 --- a/test/e2e/atlas/deployments_local_test.go +++ b/test/e2e/atlas/deployments_local_test.go @@ -62,8 +62,6 @@ func TestDeploymentsLocal(t *testing.T) { deploymentEntity, "diagnostics", deploymentName, - "-o", - "json", ) cmd.Env = os.Environ() @@ -92,7 +90,9 @@ func TestDeploymentsLocal(t *testing.T) { cmd := exec.Command(cliPath, deploymentEntity, "delete", - "test", + deploymentName, + "--type", + "local", "--force", )