From 0470f0790ef5cafac30039dc250f2fd17248dec3 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Wed, 9 Dec 2015 15:53:23 -0800 Subject: [PATCH] Add pid to containers output Signed-off-by: Michael Crosby --- ctr/container.go | 4 ++-- linux/linux.go | 5 ----- supervisor.go | 6 ------ worker.go | 6 ------ 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/ctr/container.go b/ctr/container.go index 9197a3d..70f05f3 100644 --- a/ctr/container.go +++ b/ctr/container.go @@ -45,9 +45,9 @@ func listContainers(context *cli.Context) { fatal(err.Error(), 1) } w := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0) - fmt.Fprint(w, "ID\tPATH\tSTATUS\n") + fmt.Fprint(w, "ID\tPATH\tSTATUS\tPID1\n") for _, c := range resp.Containers { - fmt.Fprintf(w, "%s\t%s\t%s\n", c.Id, c.BundlePath, c.Status) + fmt.Fprintf(w, "%s\t%s\t%s\n", c.Id, c.BundlePath, c.Status, c.Processes[0].Pid) } if err := w.Flush(); err != nil { logrus.Fatal(err) diff --git a/linux/linux.go b/linux/linux.go index f831a78..8a86db5 100644 --- a/linux/linux.go +++ b/linux/linux.go @@ -15,7 +15,6 @@ import ( "syscall" "time" - "github.com/Sirupsen/logrus" "github.com/docker/containerd/runtime" "github.com/opencontainers/runc/libcontainer" "github.com/opencontainers/runc/libcontainer/configs" @@ -372,10 +371,6 @@ func (r *libcontainerRuntime) Create(id, bundlePath string, stdio *runtime.Stdio if err != nil { return nil, err } - logrus.WithFields(logrus.Fields{ - "id": id, - "bundlePath": bundlePath, - }).Debugf("create container") config, err := r.createLibcontainerConfig(id, bundlePath, spec, rspec) if err != nil { return nil, err diff --git a/supervisor.go b/supervisor.go index 9291c68..b3938b2 100644 --- a/supervisor.go +++ b/supervisor.go @@ -133,12 +133,6 @@ func (s *Supervisor) Start() error { // so that nothing else is scheduled over the top of it. goruntime.LockOSThread() for e := range s.events { - logrus.WithFields(logrus.Fields{ - "type": e.Type, - "timestamp": e.Timestamp, - "id": e.ID, - "bundlePath": e.BundlePath, - }).Debug("event received") EventsCounter.Inc(1) h, ok := s.handlers[e.Type] if !ok { diff --git a/worker.go b/worker.go index 244b91e..d77ebef 100644 --- a/worker.go +++ b/worker.go @@ -4,7 +4,6 @@ import ( "sync" "time" - "github.com/Sirupsen/logrus" "github.com/docker/containerd/runtime" ) @@ -34,11 +33,6 @@ func (w *worker) Start() { defer w.wg.Done() for t := range w.s.tasks { started := time.Now() - logrus.WithFields(logrus.Fields{ - "containerID": t.Container.ID(), - "checkpoint": t.Checkpoint, - "started": started, - }).Debug("worker received task") if t.Checkpoint != "" { if err := t.Container.Restore(t.Checkpoint); err != nil { evt := NewEvent(DeleteEventType)