Skip to content

shim: Clean up delete invocation behavior#1041

Merged
kevpar merged 1 commit intomicrosoft:masterfrom
kevpar:shim-delete
May 28, 2021
Merged

shim: Clean up delete invocation behavior#1041
kevpar merged 1 commit intomicrosoft:masterfrom
kevpar:shim-delete

Conversation

@kevpar
Copy link
Member

@kevpar kevpar commented May 28, 2021

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

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>
@kevpar kevpar merged commit 71e1621 into microsoft:master May 28, 2021
Copy link
Contributor

@ambarve ambarve left a comment

Choose a reason for hiding this comment

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

We should remove the limited read code above the OpenComputeSystem call also since now we don't delete the bundle directory and containerd will read the panic.log when deleting bundle directory.

dcantah added a commit to dcantah/containerd that referenced this pull request Jul 1, 2021
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

There's no new vendored files as nothing from hcsshim/cmd/containerd-shim-runhcs-v1
gets imported here but for containerd releases the runhcs shim binary is built from whatever
commit is vendored into containerd.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
dcantah added a commit to dcantah/containerd that referenced this pull request Jul 12, 2021
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

This time it brings in quite a few new files as 1.5 was on 0.8.16 of hcsshim
and 0.8.17 brought in a few new things. 0.8.18 doesn't actually bring in any new
vendored files but the version of the runhcs-shim built is based off of the commit
that's vendored into Containerd, so we need to vendor the version that has the fix.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
(cherry picked from commit a81f05f)
Signed-off-by: Daniel Canter <dcanter@microsoft.com>
fahedouch pushed a commit to fahedouch/containerd that referenced this pull request Oct 15, 2021
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

There's no new vendored files as nothing from hcsshim/cmd/containerd-shim-runhcs-v1
gets imported here but for containerd releases the runhcs shim binary is built from whatever
commit is vendored into containerd.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
dims pushed a commit to dims/containerd-api-only that referenced this pull request Mar 10, 2022
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

There's no new vendored files as nothing from hcsshim/cmd/containerd-shim-runhcs-v1
gets imported here but for containerd releases the runhcs shim binary is built from whatever
commit is vendored into containerd.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
dims pushed a commit to dims/containerd-api-only that referenced this pull request Mar 26, 2022
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

There's no new vendored files as nothing from hcsshim/cmd/containerd-shim-runhcs-v1
gets imported here but for containerd releases the runhcs shim binary is built from whatever
commit is vendored into containerd.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
dims pushed a commit to dims/containerd-api-only that referenced this pull request Mar 26, 2022
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

There's no new vendored files as nothing from hcsshim/cmd/containerd-shim-runhcs-v1
gets imported here but for containerd releases the runhcs shim binary is built from whatever
commit is vendored into containerd.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
akhilerm pushed a commit to akhilerm/containerd-api that referenced this pull request May 23, 2022
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

There's no new vendored files as nothing from hcsshim/cmd/containerd-shim-runhcs-v1
gets imported here but for containerd releases the runhcs shim binary is built from whatever
commit is vendored into containerd.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
yylt pushed a commit to yylt/containerd that referenced this pull request Jun 14, 2022
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

There's no new vendored files as nothing from hcsshim/cmd/containerd-shim-runhcs-v1
gets imported here but for containerd releases the runhcs shim binary is built from whatever
commit is vendored into containerd.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
akhilerm pushed a commit to akhilerm/containerd-api that referenced this pull request Jun 22, 2022
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

There's no new vendored files as nothing from hcsshim/cmd/containerd-shim-runhcs-v1
gets imported here but for containerd releases the runhcs shim binary is built from whatever
commit is vendored into containerd.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
akhilerm pushed a commit to akhilerm/containerd-api that referenced this pull request Oct 4, 2022
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

There's no new vendored files as nothing from hcsshim/cmd/containerd-shim-runhcs-v1
gets imported here but for containerd releases the runhcs shim binary is built from whatever
commit is vendored into containerd.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
akhilerm pushed a commit to akhilerm/containerd-api that referenced this pull request Oct 4, 2022
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

There's no new vendored files as nothing from hcsshim/cmd/containerd-shim-runhcs-v1
gets imported here but for containerd releases the runhcs shim binary is built from whatever
commit is vendored into containerd.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
akhilerm pushed a commit to akhilerm/containerd-test that referenced this pull request Feb 22, 2023
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

There's no new vendored files as nothing from hcsshim/cmd/containerd-shim-runhcs-v1
gets imported here but for containerd releases the runhcs shim binary is built from whatever
commit is vendored into containerd.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>

Containerd-test-commit: a81f05f
akhilerm pushed a commit to akhilerm/containerd-test that referenced this pull request Feb 22, 2023
0.8.18 contains a fix for shim delete behavior, please see:
microsoft/hcsshim#1041

There's no new vendored files as nothing from hcsshim/cmd/containerd-shim-runhcs-v1
gets imported here but for containerd releases the runhcs shim binary is built from whatever
commit is vendored into containerd.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>

Containerd-test-commit: 63f6f54
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.

4 participants