fix ocic time display
Signed-off-by: Crazykev <crazykev@zju.edu.cn>
This commit is contained in:
parent
e790094f23
commit
82a01cbdda
2 changed files with 6 additions and 6 deletions
|
@ -376,15 +376,15 @@ func ContainerStatus(client pb.RuntimeServiceClient, ID string) error {
|
|||
fmt.Printf("Status: %s\n", r.Status.State)
|
||||
}
|
||||
if r.Status.CreatedAt != nil {
|
||||
ctm := time.Unix(*r.Status.CreatedAt, 0)
|
||||
ctm := time.Unix(0, *r.Status.CreatedAt)
|
||||
fmt.Printf("Created: %v\n", ctm)
|
||||
}
|
||||
if r.Status.StartedAt != nil {
|
||||
stm := time.Unix(*r.Status.StartedAt, 0)
|
||||
stm := time.Unix(0, *r.Status.StartedAt)
|
||||
fmt.Printf("Started: %v\n", stm)
|
||||
}
|
||||
if r.Status.FinishedAt != nil {
|
||||
ftm := time.Unix(*r.Status.FinishedAt, 0)
|
||||
ftm := time.Unix(0, *r.Status.FinishedAt)
|
||||
fmt.Printf("Finished: %v\n", ftm)
|
||||
}
|
||||
if r.Status.ExitCode != nil {
|
||||
|
@ -448,7 +448,7 @@ func ListContainers(client pb.RuntimeServiceClient, opts listOptions) error {
|
|||
fmt.Printf("Status: %s\n", *c.State)
|
||||
}
|
||||
if c.CreatedAt != nil {
|
||||
ctm := time.Unix(*c.CreatedAt, 0)
|
||||
ctm := time.Unix(0, *c.CreatedAt)
|
||||
fmt.Printf("Created: %v\n", ctm)
|
||||
}
|
||||
if c.Labels != nil {
|
||||
|
|
|
@ -292,7 +292,7 @@ func PodSandboxStatus(client pb.RuntimeServiceClient, ID string) error {
|
|||
fmt.Printf("Status: %s\n", r.Status.State)
|
||||
}
|
||||
if r.Status.CreatedAt != nil {
|
||||
ctm := time.Unix(*r.Status.CreatedAt, 0)
|
||||
ctm := time.Unix(0, *r.Status.CreatedAt)
|
||||
fmt.Printf("Created: %v\n", ctm)
|
||||
}
|
||||
if r.Status.Linux != nil {
|
||||
|
@ -366,7 +366,7 @@ func ListPodSandboxes(client pb.RuntimeServiceClient, opts listOptions) error {
|
|||
}
|
||||
}
|
||||
fmt.Printf("Status: %s\n", pod.State)
|
||||
ctm := time.Unix(*pod.CreatedAt, 0)
|
||||
ctm := time.Unix(0, *pod.CreatedAt)
|
||||
fmt.Printf("Created: %v\n", ctm)
|
||||
if pod.Labels != nil {
|
||||
fmt.Println("Labels:")
|
||||
|
|
Loading…
Reference in a new issue