capactio / capact

Simple way to manage applications and infrastructure.
https://capact.io
Apache License 2.0
80 stars 19 forks source link

Add option to cancel running Capact Action #553

Open mszostok opened 2 years ago

mszostok commented 2 years ago

Description

Currently, there is no option to cancel an Action directly with our API. Temporary solution is to cancel hidden Argo workflow directly.

We also need to decide what we want to do when the Action is canceled. Context: Deletion/Cancelling in running state is complicated as such Action can be in the middle of e.g. data migration, system shutdown, creating resources on hyperscaler side, etc. So we need to decide what to do, e.g.: cancel running actions, maybe even rollback already executed steps (see: https://github.com/capactio/capact/issues/502), etc.

For now, we ignore the delete/cancel request: https://github.com/capactio/capact/blob/9da725c4c5701653a35c6d3368b305522002029f/internal/k8s-engine/controller/action_service.go#L176-L185

This task can be related with retry, see comment: https://github.com/capactio/capact/issues/441#issuecomment-896565568

It can be also related to rollback: #502

Reason

Currently, the delete/cancel request is ignored by our controller. As a result, user needs to wait for Action completion and rollback all changes manually even though they knew that stopping that action was needed before it was finished.

Use cases