flyctl: Some flyctl commands do not provide a flag to confirm prompts in advance
Describe the bug
Most flyctl commands provide a flag to skip the warning/confirmation prompt that comes up when running a command with a different --app than that in the fly.toml configuration file, such as --yes. I have found that all flyctl secrets sub-commands do not have this option, making them harder to use in automated environments such as CI.
- Operating system: -
fly version: v0.0.320
** Command output: **
$ fly secrets set --app <some other app> AUTH_SECRET=$(openssl rand -base64 40) # ...
WARN app flag '<other app>' does not match app name in config file '<current app>'
? Continue using '<other app>' (y/N) ...
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 3
- Comments: 15 (8 by maintainers)
We want any command that asks for confirmation to do this. I can’t say which anecdotally, so worth digging in code for usage of
survey.Confirmprompt.Confirm,confirmetc.Running into this issue as well. Tried all the same approaches as @3x071c, in addition to
yes | flyctl ..., all resulting in the EOF behaviour.Unfortunately this renders a number of the commands unusable for automated deployments.
This is harder than I expected. Most ways of simulating user input (by piping
echo, possibly in a subshell, or a here docstring) result in fly complaining about an EOF in the input. Is there a temporary workaround for this?