Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions cmd/containerd-shim-runhcs-v1/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"time"

"github.com/Microsoft/hcsshim/internal/hcs"
Expand All @@ -30,6 +29,7 @@ The delete command will be executed in the container's bundle as its cwd.
// We cant write anything to stdout for this cmd other than the
// task.DeleteResponse by protcol. We can write to stderr which will be
// warning logged in containerd.
logrus.SetOutput(ioutil.Discard)

ctx, span := trace.StartSpan(gcontext.Background(), "delete")
defer span.End()
Expand All @@ -40,15 +40,6 @@ The delete command will be executed in the container's bundle as its cwd.
return errors.New("bundle is required")
}

// hcsshim shim writes panic logs in the bundle directory in a file named "panic.log"
// log those messages (if any) on stderr so that it shows up in containerd's log.
// This should be done as the first thing so that we don't miss any panic logs even if
// something goes wrong during delete op.
logs, err := ioutil.ReadFile(filepath.Join(bundleFlag, "panic.log"))
if err == nil && len(logs) > 0 {
logrus.WithField("log", string(logs)).Error("found shim panic logs during delete")
}

// Attempt to find the hcssystem for this bundle and terminate it.
if sys, _ := hcs.OpenComputeSystem(ctx, idFlag); sys != nil {
defer sys.Close()
Expand Down