File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ package machine
3
3
import (
4
4
"context"
5
5
"fmt"
6
+ "github.com/superfly/flyctl/internal/appconfig"
7
+ "strings"
6
8
7
9
"github.com/spf13/cobra"
8
10
"github.com/superfly/flyctl/flaps"
@@ -59,10 +61,16 @@ func runMachineStart(ctx context.Context) (err error) {
59
61
func Start (ctx context.Context , machineID string ) (err error ) {
60
62
machine , err := flaps .FromContext (ctx ).Start (ctx , machineID , "" )
61
63
if err != nil {
62
- if err := rewriteMachineNotFoundErrors (ctx , err , machineID ); err != nil {
63
- return err
64
+ //TODO(dov): just do the clone
65
+ switch {
66
+ case strings .Contains (err .Error (), " for machine" ):
67
+ return fmt .Errorf ("could not start machine due to lack of capacity. Try 'flyctl machine clone %s -a %s'" , machineID , appconfig .NameFromContext (ctx ))
68
+ default :
69
+ if err := rewriteMachineNotFoundErrors (ctx , err , machineID ); err != nil {
70
+ return err
71
+ }
72
+ return fmt .Errorf ("could not start machine %s: %w" , machineID , err )
64
73
}
65
- return fmt .Errorf ("could not start machine %s: %w" , machineID , err )
66
74
}
67
75
68
76
if machine .Status == "error" {
You can’t perform that action at this time.
0 commit comments