mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Merge pull request #44326 from xlgao-zju/forcibly-remove
Automatic merge from submit-queue (batch tested with PRs 44326, 45768) [CRI] Forcibly remove container Forcibly remove the running containers in `RemoveContainer`. Since we should forcibly remove the running containers in `RemovePodSandbox`. See [here](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/api/v1alpha1/runtime/api.proto#L35). cc @feiskyer @Random-Liu Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
This commit is contained in:
@@ -237,7 +237,7 @@ func (ds *dockerService) RemovePodSandbox(podSandboxID string) error {
|
||||
}
|
||||
|
||||
// Remove the sandbox container.
|
||||
if err := ds.client.RemoveContainer(podSandboxID, dockertypes.ContainerRemoveOptions{RemoveVolumes: true}); err != nil && !libdocker.IsContainerNotFoundError(err) {
|
||||
if err := ds.client.RemoveContainer(podSandboxID, dockertypes.ContainerRemoveOptions{RemoveVolumes: true, Force: true}); err != nil && !libdocker.IsContainerNotFoundError(err) {
|
||||
errs = append(errs, err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user