MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / deleteRun

Function deleteRun

pkg/cmd/space/delete/delete.go:67–86  ·  view source on GitHub ↗
(f factory.Factory, cmd *cobra.Command)

Source from the content-addressed store, hash-verified

65}
66
67func deleteRun(f factory.Factory, cmd *cobra.Command) error {
68 octopus, err := f.GetSystemClient(apiclient.NewRequester(cmd))
69 if err != nil {
70 return err
71 }
72
73 existingSpaces, err := octopus.Spaces.GetAll()
74 if err != nil {
75 return err
76 }
77
78 itemToDelete, err := selectors.ByName(f.Ask, existingSpaces, "Select the space you wish to delete:")
79 if err != nil {
80 return err
81 }
82
83 return question.DeleteWithConfirmation(f.Ask, "space", itemToDelete.Name, itemToDelete.ID, func() error {
84 return stopQueueAndDelete(octopus, itemToDelete)
85 })
86}
87
88func stopQueueAndDelete(client *client.Client, spaceToDelete *spaces.Space) error {
89 if !spaceToDelete.TaskQueueStopped {

Callers 1

NewCmdDeleteFunction · 0.70

Calls 5

NewRequesterFunction · 0.92
ByNameFunction · 0.92
DeleteWithConfirmationFunction · 0.92
stopQueueAndDeleteFunction · 0.85
GetSystemClientMethod · 0.65

Tested by

no test coverage detected