Add pid to containers output

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2015-12-09 15:53:23 -08:00
parent 1d3349128e
commit 0470f0790e
4 changed files with 2 additions and 19 deletions

View file

@ -45,9 +45,9 @@ func listContainers(context *cli.Context) {
fatal(err.Error(), 1) fatal(err.Error(), 1)
} }
w := tabwriter.NewWriter(os.Stdout, 20, 1, 3, ' ', 0) 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 { 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 { if err := w.Flush(); err != nil {
logrus.Fatal(err) logrus.Fatal(err)

View file

@ -15,7 +15,6 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/Sirupsen/logrus"
"github.com/docker/containerd/runtime" "github.com/docker/containerd/runtime"
"github.com/opencontainers/runc/libcontainer" "github.com/opencontainers/runc/libcontainer"
"github.com/opencontainers/runc/libcontainer/configs" "github.com/opencontainers/runc/libcontainer/configs"
@ -372,10 +371,6 @@ func (r *libcontainerRuntime) Create(id, bundlePath string, stdio *runtime.Stdio
if err != nil { if err != nil {
return nil, err return nil, err
} }
logrus.WithFields(logrus.Fields{
"id": id,
"bundlePath": bundlePath,
}).Debugf("create container")
config, err := r.createLibcontainerConfig(id, bundlePath, spec, rspec) config, err := r.createLibcontainerConfig(id, bundlePath, spec, rspec)
if err != nil { if err != nil {
return nil, err return nil, err

View file

@ -133,12 +133,6 @@ func (s *Supervisor) Start() error {
// so that nothing else is scheduled over the top of it. // so that nothing else is scheduled over the top of it.
goruntime.LockOSThread() goruntime.LockOSThread()
for e := range s.events { 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) EventsCounter.Inc(1)
h, ok := s.handlers[e.Type] h, ok := s.handlers[e.Type]
if !ok { if !ok {

View file

@ -4,7 +4,6 @@ import (
"sync" "sync"
"time" "time"
"github.com/Sirupsen/logrus"
"github.com/docker/containerd/runtime" "github.com/docker/containerd/runtime"
) )
@ -34,11 +33,6 @@ func (w *worker) Start() {
defer w.wg.Done() defer w.wg.Done()
for t := range w.s.tasks { for t := range w.s.tasks {
started := time.Now() started := time.Now()
logrus.WithFields(logrus.Fields{
"containerID": t.Container.ID(),
"checkpoint": t.Checkpoint,
"started": started,
}).Debug("worker received task")
if t.Checkpoint != "" { if t.Checkpoint != "" {
if err := t.Container.Restore(t.Checkpoint); err != nil { if err := t.Container.Restore(t.Checkpoint); err != nil {
evt := NewEvent(DeleteEventType) evt := NewEvent(DeleteEventType)