Add pid to containers output
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
1d3349128e
commit
0470f0790e
4 changed files with 2 additions and 19 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue