Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func (u *runnerImpl) Start(ctx context.Context, options ...compose.StartOption)
func (u *runnerImpl) Cancel(ctx context.Context) error {
return u.store.lock(func(db *session) error {
if !u.State.IsOneOf(StateCreated, StateInitializing, StateInitialized,
StateFetching, StateFetched, StateInstalling, StateInstalled) {
StateFetching, StateFetched, StateInstalling, StateInstalled, StateCompleting) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will allow users to "cancel" an update that has been successfully started, as a result successful update is considered as "failing".

Maybe we rather should fix the "composectl update complete" implementation, so it guarantees moving the update state to the "completed" as long as the update is successfully started.

return fmt.Errorf("cannot cancel update when it is in state %q", u.State)
}

Expand Down