From 41ff938521ec0ddd45d273a7fbe6618403f6dadf Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Wed, 30 Aug 2023 15:38:11 +0200 Subject: Add app name and zone to messages --- client/go/internal/cli/cmd/destroy.go | 5 ++--- client/go/internal/cli/cmd/destroy_test.go | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'client/go/internal/cli') diff --git a/client/go/internal/cli/cmd/destroy.go b/client/go/internal/cli/cmd/destroy.go index 316eb6022ca..4df81179318 100644 --- a/client/go/internal/cli/cmd/destroy.go +++ b/client/go/internal/cli/cmd/destroy.go @@ -36,9 +36,8 @@ $ vespa destroy --force`, if err != nil { return err } - description := "current deployment" + description := target.Deployment().String() if target.IsCloud() { - description = target.Deployment().String() env := target.Deployment().Zone.Environment if env != "dev" && env != "perf" { return errHint(fmt.Errorf("cannot remove production %s", description), "See https://cloud.vespa.ai/en/deleting-applications") @@ -46,7 +45,7 @@ $ vespa destroy --force`, } ok := force if !ok { - cli.printWarning(fmt.Sprintf("This operation will irrecoverably remove %s and all of its data", color.RedString(description))) + cli.printWarning(fmt.Sprintf("This operation will irrecoverably remove the %s and all of its data", color.RedString(description))) ok, _ = cli.confirm("Proceed with removal?", false) } if ok { diff --git a/client/go/internal/cli/cmd/destroy_test.go b/client/go/internal/cli/cmd/destroy_test.go index c6198b9b877..3cc106fb83c 100644 --- a/client/go/internal/cli/cmd/destroy_test.go +++ b/client/go/internal/cli/cmd/destroy_test.go @@ -22,9 +22,9 @@ func TestDestroy(t *testing.T) { // No removal without confirmation buf.WriteString("\n") require.NotNil(t, cli.Run("destroy")) - warning := "Warning: This operation will irrecoverably remove current deployment and all of its data" + warning := "Warning: This operation will irrecoverably remove the deployment of default.application.default in prod.default and all of its data" confirmation := "Proceed with removal? [y/N] " - assert.Equal(t, warning+"\nError: refusing to remove current deployment without confirmation\n", stderr.String()) + assert.Equal(t, warning+"\nError: refusing to remove deployment of default.application.default in prod.default without confirmation\n", stderr.String()) assert.Equal(t, confirmation, stdout.String()) // Removes deployment with confirmation @@ -32,7 +32,7 @@ func TestDestroy(t *testing.T) { stderr.Reset() buf.WriteString("y\n") require.Nil(t, cli.Run("destroy")) - success := "Success: Removed current deployment\n" + success := "Success: Removed deployment of default.application.default in prod.default\n" assert.Equal(t, confirmation+success, stdout.String()) // Force flag always removes deployment -- cgit v1.2.3