Skip to content

Commit 3de7df8

Browse files
committed
crictl inspecti fail to unmarshal
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
1 parent 31e2aec commit 3de7df8

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

cmd/crictl/util.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,7 @@ func outputStatusInfo(status string, info map[string]string, format string) erro
222222

223223
jsonInfo := "{" + "\"status\":" + status + ","
224224
for _, k := range keys {
225-
var res interface{}
226-
// We attempt to convert key into JSON if possible else use it directly
227-
if err := json.Unmarshal([]byte(info[k]), res); err != nil {
228-
jsonInfo += "\"" + k + "\"" + ":" + "\"" + info[k] + "\","
229-
} else {
230-
jsonInfo += "\"" + k + "\"" + ":" + info[k] + ","
231-
}
225+
jsonInfo += "\"" + k + "\"" + ":" + info[k] + ","
232226
}
233227
jsonInfo = jsonInfo[:len(jsonInfo)-1]
234228
jsonInfo += "}"

0 commit comments

Comments
 (0)