kubernetes-sigs / kubernetes-sigs/cli-utils

Feature Request: Allow cancellation of running applier/destroyer tasks

Open
#440 5 comments 3 reactions 0 assignees View on GitHub
lifecycle/frozen
Dominant language
Go
Stars
178
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Currently, the baserunner handles context cancellation, but the only task it can currently interrupt is WaitTask, which it does by calling private methods (eww).

As a user who uses the global context for cancellation/timeout, I want to be able to interrupt the applier/destoryer and have it exit quickly, without finishing the ApplyTask/PruneTask.

Solution:
- Pass context to tasks by adding it to the TaskContext
- Update all tasks to handle context.Done() and exit early
- Update all tasks to pass the context to all network calls, so they also can be cancelled (most already take a context)
- Add a Task method to handle status events, so WaitTask can exit early.

Contributor guide

Open the contributing guide

Research direction

Start by tracing TaskContext and the baserunner's handling of context cancellation, then inspect WaitTask, ApplyTask, PruneTask, and the other tasks. Check which network calls already accept a context and how status events are handled. Done means applier and destroyer tasks exit promptly on cancellation, network calls receive the context, and WaitTask no longer depends on private methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.