Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow exit immediately functionality on runcmd list #133

Open
anmazzotti opened this issue Oct 25, 2024 · 0 comments
Open

Allow exit immediately functionality on runcmd list #133

anmazzotti opened this issue Oct 25, 2024 · 0 comments

Comments

@anmazzotti
Copy link

Currently all commands in a runcmd/commands list will be executed independently of each other.
If the first command fails, all the others will still be executed.

Note that this is also the cloud-init behavior, so this should count as a yip only feature request.

The request is to make this behavior toggable in yip. For example by adding stage options:

stages:
   my-stage:
     options:
       exitImmediately: true
     commands:
        - exit 2
        - echo "Success"

It would also be nice to enforce this value on all configs with an environment variable, so that it can be applied to cloud-init syntax configs as well.

This could help all those cases where a complex list of dependent commands needs to be executed, making the config itself more readable (instead of a giant pipe or an opaque bash script).

Could also help circumventing/mitigating issues like this one: rancher/cluster-api-provider-rke2#221

Still this would differ from cloud-init behavior, so it should be used with care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant