Skip to content

Commit 7e13981

Browse files
committed
remove useless kill rm cmd
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
1 parent 7276e4e commit 7e13981

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- main
77
- 'release/**'
8+
- remove-useless-kill-rm-cmd
89
pull_request:
910

1011
jobs:

cmd/nerdctl/rm.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,6 @@ func removeContainer(ctx context.Context, cmd *cobra.Command, container containe
196196
if !force {
197197
return statusError{fmt.Errorf("you cannot remove a %v container %v. Stop the container before attempting removal or force remove", status.Status, id)}
198198
}
199-
if err := task.Kill(ctx, syscall.SIGKILL); err != nil {
200-
logrus.WithError(err).Warnf("failed to send SIGKILL")
201-
}
202-
es, err := task.Wait(ctx)
203-
if err == nil {
204-
<-es
205-
}
206199
_, err = task.Delete(ctx, containerd.WithProcessKill)
207200
if err != nil && !errdefs.IsNotFound(err) {
208201
logrus.WithError(err).Warnf("failed to delete task %v", id)

0 commit comments

Comments
 (0)