Skip to content

[release/0.8] shim: Clean up delete invocation behavior#1042

Merged
kevpar merged 1 commit intomicrosoft:release/0.8from
kevpar:0.8-shim-delete
Jun 1, 2021
Merged

[release/0.8] shim: Clean up delete invocation behavior#1042
kevpar merged 1 commit intomicrosoft:release/0.8from
kevpar:0.8-shim-delete

Conversation

@kevpar
Copy link
Copy Markdown
Member

@kevpar kevpar commented May 28, 2021

Backport of 450cdb1 for release/0.8.

This changes the behavior when the shim is invoked with the "delete"
command line argument.

Previously, the delete path did two things it should not:

  • Attempted to locate the sandbox container for the pod and delete it as
    well. This meant if "shim delete" was invoked for a workload
    container, it could bring down the whole pod. The only reason we did
    not see this in the past is that prior to containerd 1.5 "shim delete"
    was not called for successful container stop operations.

  • Deleted the bundle directory. We shouldn't do this in the shim, as
    containerd does it itself.

For reference on what the Linux shim does, see here: https://github.com/containerd/containerd/blob/master/runtime/v2/runc/v2/service.go#L291

Signed-off-by: Kevin Parsons kevpar@microsoft.com
(cherry picked from commit 450cdb1)
Signed-off-by: Kevin Parsons kevpar@microsoft.com

This changes the behavior when the shim is invoked with the "delete"
command line argument.

Previously, the delete path did two things it should not:
- Attempted to locate the sandbox container for the pod and delete it as
  well. This meant if "shim delete" was invoked for a workload
  container, it could bring down the whole pod. The only reason we did
  not see this in the past is that prior to containerd 1.5 "shim delete"
  was not called for successful container stop operations.

- Deleted the bundle directory. We shouldn't do this in the shim, as
  containerd does it itself.

For reference on what the Linux shim does, see here: https://github.com/containerd/containerd/blob/master/runtime/v2/runc/v2/service.go#L291

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
(cherry picked from commit 450cdb1)
Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
@kevpar kevpar requested a review from a team as a code owner May 28, 2021 23:58
@kevpar kevpar merged commit a14fe37 into microsoft:release/0.8 Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants