Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crictl inspecti fail to unmarshal #378

Merged
merged 2 commits into from
Sep 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/crictl/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/crictl/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

jsonInfo += "\"" + k + "\"" + ":" + "\"" + info[k] + "\","
} else {
jsonInfo += "\"" + k + "\"" + ":" + info[k] + ","
Expand Down