akuity / kargo

Application lifecycle orchestration
https://kargo.akuity.io/
Apache License 2.0
1.57k stars 137 forks source link

Ability to terminate a Running Promotion #2662

Open jessesuen opened 1 week ago

jessesuen commented 1 week ago

Proposed Feature

When hitting https://github.com/akuity/kargo/issues/2661, it became apparent that we need the ability to terminate promotions since they might be long-lived, or bugs might cause them to get stuck running.

Motivation

I no longer want a Promotion to run.

Suggested Implementation

Introduce a terminate field in a Promotion, that would be set by API server by a user interaction:

spec:
  terminate: {}

Note that terminate is a struct instead of a boolean, because we might want different termination options, e.g. gracefully close PRs that were opened (SIGTERM), or do nothing like a kill -9 (SIGKILL).

hiddeco commented 1 week ago

I am unsure if this should be declared in-spec, or be more like the current abort annotation we have for the verification process of a Stage.

krancour commented 1 week ago

Verifications aren't themselves a CR, so an annotation on a Stage to kill a verification feels like it makes sense.

If we did go an annotation-based route here, couldn't we apply that annotation directly to the Promotion instead of on the Stage?

hiddeco commented 1 week ago

If we did go an annotation-based route here, couldn't we apply that annotation directly to the Promotion instead of on the Stage?

Yes, that's actually what I was suggesting.