I just spotted a possible discrepancy for the “on-failure” restart mode. If I get info about a machine using the RESTful API, I get this:
[config] => Array
(
[init] => Array
(
)
[guest] => Array
(
[cpu_kind] => shared
[cpus] => 1
[memory_mb] => 256
)
[image] => registry.fly.io/sequoia-browser-test:small@sha256:xxx
[restart] => Array
(
[policy] => on-failure
[max_retries] => 10
)
[dns] => Array
(
)
)
The restart key matches the docs:
restart: Defines whether and how flyd restarts a Machine after its main process exits. Learn more about Machine restart policies. This object has the following options:
policy: string - Required. One of “no”, “on-failure”, or “always”.max_retries: int (nil) - The maximum number of retries when the policy is “on-failure”.
However, if I do flyctl machine create --help, I get (in part) this:
--restart string Set the restart policy for a Machine. Options include 'no', 'always', and
'on-fail'.
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'.
I wonder if this help text is incorrect, and this should be on-failure. It’s the same for flyctl machine update too.