Skip to content

Commit

Permalink
Merge pull request #1042 from kevpar/0.8-shim-delete
Browse files Browse the repository at this point in the history
[release/0.8] shim: Clean up delete invocation behavior
  • Loading branch information
kevpar committed Jun 1, 2021
2 parents 407147a + c2840dd commit a14fe37
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions cmd/containerd-shim-runhcs-v1/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,6 @@ The delete command will be executed in the container's bundle as its cwd.
}
}

// Determine if the config file was a POD and if so kill the whole POD.
if s, err := getSpecAnnotations(bundleFlag); err != nil {
if !os.IsNotExist(err) {
return err
}
} else {
if containerType := s["io.kubernetes.cri.container-type"]; containerType == "container" {
if sandboxID := s["io.kubernetes.cri.sandbox-id"]; sandboxID != "" {
if sys, _ := hcs.OpenComputeSystem(ctx, sandboxID); sys != nil {
if err := sys.Terminate(ctx); err != nil {
fmt.Fprintf(os.Stderr, "failed to terminate '%s': %v", idFlag, err)
} else if err := sys.Wait(); err != nil {
fmt.Fprintf(os.Stderr, "failed to wait for '%s' to terminate: %v", idFlag, err)
}
sys.Close()
}
}
}
}

// Remove the bundle on disk
if err := os.RemoveAll(bundleFlag); err != nil && !os.IsNotExist(err) {
return err
}

if data, err := proto.Marshal(&task.DeleteResponse{
ExitedAt: time.Now(),
ExitStatus: 255,
Expand Down

0 comments on commit a14fe37

Please sign in to comment.