Skip to content

Commit

Permalink
v8(services): update warning for delete service instance
Browse files Browse the repository at this point in the history
- match the style of delete space
- add that service instance will be unshared

[#176115596](https://www.pivotaltracker.com/story/show/176115596)

Co-authored-by: Marcela Campo <[email protected]>
  • Loading branch information
blgm and pivotal-marcela-campo committed Jan 5, 2021
1 parent 231f0af commit 5acd85b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion command/v7/delete_service_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ func (cmd DeleteServiceCommand) displayEvent() error {
}

func (cmd DeleteServiceCommand) displayPrompt() (bool, error) {
cmd.UI.DisplayText("This action impacts all resources scoped to this service instance, including service bindings, service keys and route bindings.")
cmd.UI.DisplayText("This will remove the service instance from any spaces where it has been shared.")

delete, err := cmd.UI.DisplayBoolPrompt(
false,
"Really delete the service instance {{.ServiceInstanceName}}, including app bindings, route bindings, and service keys?",
"Really delete the service instance {{.ServiceInstanceName}}?",
cmd.serviceInstanceName(),
)
if err != nil {
Expand Down
7 changes: 4 additions & 3 deletions command/v7/delete_service_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,10 @@ var _ = Describe("delete-service command", func() {
})

It("prompts the user", func() {
Expect(testUI.Out).To(Say(
`Really delete the service instance %s, including app bindings, route bindings, and service keys\? \[yN\]:`,
serviceInstanceName,
Expect(testUI.Out).To(SatisfyAll(
Say(`This action impacts all resources scoped to this service instance, including service bindings, service keys and route bindings\.`),
Say(`This will remove the service instance from any spaces where it has been shared\.`),
Say(`Really delete the service instance %s\? \[yN\]:`, serviceInstanceName),
))
})

Expand Down
2 changes: 1 addition & 1 deletion command/v7/delete_space_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (cmd DeleteSpaceCommand) Execute(args []string) error {

if !cmd.Force {
cmd.UI.DisplayText("This action impacts all resources scoped to this space, including apps, service instances, and space-scoped service brokers.")
promptMessage := "Really delete the space {{.SpaceName}}?"
const promptMessage = "Really delete the space {{.SpaceName}}?"
deleteSpace, promptErr := cmd.UI.DisplayBoolPrompt(false, promptMessage, map[string]interface{}{"SpaceName": cmd.RequiredArgs.Space})

if promptErr != nil {
Expand Down

0 comments on commit 5acd85b

Please sign in to comment.