Skip to content

Commit 95396de

Browse files
author
Fly Dev
committed
Fix restart policy from 'on-fail' to 'on-failure'
- Update case statement in internal/command/machine/run.go - Update flag description to use correct policy name - Update enum arrays in internal/command/mcp/server/machine.go - Aligns with Docker restart policy standard and Machines API Fixes #2844
1 parent e0e7006 commit 95396de

File tree

3 files changed

+6
-33
lines changed

3 files changed

+6
-33
lines changed

internal/command/machine/run.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ var sharedFlags = flag.Set{
126126
},
127127
flag.String{
128128
Name: "restart",
129-
Description: `Set the restart policy for a Machine. Options include 'no', 'always', and 'on-fail'.
130-
Default is 'on-fail' for Machines created by 'fly deploy' and Machines with a schedule. Default is 'always' for Machines created by 'fly m run'.`,
129+
Description: `Set the restart policy for a Machine. Options include 'no', 'always', and 'on-failure'.
130+
Default is 'on-failure' for Machines created by 'fly deploy' and Machines with a schedule. Default is 'always' for Machines created by 'fly m run'.`,
131131
},
132132
flag.StringSlice{
133133
Name: "standby-for",
@@ -780,7 +780,7 @@ func determineMachineConfig(
780780
machineConf.Restart = &fly.MachineRestart{
781781
Policy: fly.MachineRestartPolicyNo,
782782
}
783-
case "on-fail":
783+
case "on-failure":
784784
machineConf.Restart = &fly.MachineRestart{
785785
Policy: fly.MachineRestartPolicyOnFailure,
786786
}

internal/command/mcp/server/machine.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ var MachineCommands = []FlyCommand{
309309
Description: "Restart policy for the new machine",
310310
Required: false,
311311
Type: "enum",
312-
Enum: []string{"no", "always", "on-fail"},
312+
Enum: []string{"no", "always", "on-failure"},
313313
},
314314
"rm": {
315315
Description: "Automatically remove the Machine when it exits",
@@ -986,7 +986,7 @@ var MachineCommands = []FlyCommand{
986986
Description: "Restart policy for the new machine",
987987
Required: false,
988988
Type: "enum",
989-
Enum: []string{"no", "always", "on-fail"},
989+
Enum: []string{"no", "always", "on-failure"},
990990
},
991991
"rm": {
992992
Description: "Automatically remove the Machine when it exits",
@@ -1482,7 +1482,7 @@ var MachineCommands = []FlyCommand{
14821482
Description: "Restart policy for the new machine",
14831483
Required: false,
14841484
Type: "enum",
1485-
Enum: []string{"no", "always", "on-fail"},
1485+
Enum: []string{"no", "always", "on-failure"},
14861486
},
14871487
"schedule": {
14881488
Description: "Schedule for the new machine",

notes.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)