Open redbeam opened 1 month ago
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign anjannath for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
@cfergeau yes, the s.startCancel()
function called in cancelUnlocked
is actually the cancel function of the context. And it works as expected.
And yes, the context is also provided to the decompression code.
@redbeam: The following test failed, say /retest
to rerun all failed tests or /retest-required
to rerun all mandatory failed tests:
Test name | Commit | Details | Required | Rerun command |
---|---|---|---|---|
ci/prow/e2e-crc | b6ffde2d4cd4b35bd070e7be5fcf44a64fb46cf2 | link | true | /test e2e-crc |
Full PR test history. Your PR dashboard.
Fixes: Issue #3998
Solution/Idea
Added a
context.Context
argument to functions such asbundle.Download
andbundle.Extract
and others, to allow them to gracefully stop (if they are running) when thestop
command is issued through the HTTP API.Context support was added to regular HTTP bundle downloads as well as bundle pulls from container registries (it was supported by the used libraries). However, for the bundle decompression, this had to be done manually, since there is no library used.
If there is no context available to be used,
nil
orcontext.Background()
can be used.Testing
Caveat
The
stop
command ends withInstance is already stopped
error (error code 500 is returned) since it is intended to stop the machine, which is (at that moment) not running. But it stops the download/decompression, which is desired.