Skip to content

Commit daf1d25

Browse files
committed
fix droplet cleanup bug
1 parent 50d1c8c commit daf1d25

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cmd/cloudexec/clean.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import (
1212
func ConfirmDeleteDroplets(config config.Config, dropletName string, instanceToJobs map[int64][]int64) error {
1313
instances, err := do.GetDropletsByName(config, dropletName)
1414
if err != nil {
15-
return fmt.Errorf("Failed to get droplet by name: %w", err)
15+
return fmt.Errorf("Failed to get droplets by name: %w", err)
1616
}
1717
if len(instances) > 0 {
1818
// TODO: support multiple droplets
19-
fmt.Println("existing instance(s) found:")
19+
fmt.Printf("Existing %s instance(s) found:\n", dropletName)
2020
for _, instance := range instances {
2121
// get a pretty string describing the jobs associated with this instance
2222
if instanceToJobs == nil {
@@ -47,7 +47,7 @@ func ConfirmDeleteDroplets(config config.Config, dropletName string, instanceToJ
4747
}
4848
}
4949
} else {
50-
fmt.Println("zero instances found")
50+
fmt.Printf("Zero %s instances found\n", dropletName)
5151
}
5252
return nil
5353
}

cmd/cloudexec/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ func main() {
259259
if err != nil {
260260
return err
261261
}
262-
err = ConfirmDeleteDroplets(config, username, instanceToJobs)
262+
err = ConfirmDeleteDroplets(config, dropletName, instanceToJobs)
263263
if err != nil {
264264
return err
265265
}

0 commit comments

Comments
 (0)