diff --git a/cmd/crictl/image.go b/cmd/crictl/image.go index 06898967d3..ed8276fe40 100644 --- a/cmd/crictl/image.go +++ b/cmd/crictl/image.go @@ -170,6 +170,7 @@ var listImageCommand = cli.Command{ id := image.Id if !noTrunc { id = getTruncatedID(id, "sha256:") + repoDigest = getTruncatedID(repoDigest, "sha256:") } for _, repoTagPair := range repoTagPairs { if showDigest { @@ -194,8 +195,9 @@ var listImageCommand = cli.Command{ fmt.Printf("Uid: %v\n", image.Uid) } if image.Username != "" { - fmt.Printf("Username: %v\n\n", image.Username) + fmt.Printf("Username: %v\n", image.Username) } + fmt.Printf("\n") } w.Flush() return nil diff --git a/cmd/crictl/util.go b/cmd/crictl/util.go index d0c98e0f29..0c529a4d35 100644 --- a/cmd/crictl/util.go +++ b/cmd/crictl/util.go @@ -224,7 +224,7 @@ func outputStatusInfo(status string, info map[string]string, format string) erro for _, k := range keys { var res interface{} // We attempt to convert key into JSON if possible else use it directly - if err := json.Unmarshal([]byte(info[k]), res); err != nil { + if err := json.Unmarshal([]byte(info[k]), &res); err != nil { jsonInfo += "\"" + k + "\"" + ":" + "\"" + info[k] + "\"," } else { jsonInfo += "\"" + k + "\"" + ":" + info[k] + ","