ctr: add ctr snapshot info <key>

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2017-08-15 06:24:43 +00:00
parent 22df20b35f
commit fef7f3addc
4 changed files with 43 additions and 21 deletions

View File

@@ -3,12 +3,9 @@
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net"
"os"
"time"
gocontext "context"
@@ -185,15 +182,7 @@ var shimStateCommand = cli.Command{
if err != nil {
return err
}
data, err := json.Marshal(r)
if err != nil {
return err
}
buf := bytes.NewBuffer(nil)
if err := json.Indent(buf, data, " ", " "); err != nil {
return err
}
buf.WriteTo(os.Stdout)
printAsJSON(r)
return nil
},
}