summaryrefslogtreecommitdiff
path: root/cmd/podman/inspect/inspect.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-04-05 17:44:15 +0200
committerGitHub <noreply@github.com>2021-04-05 17:44:15 +0200
commit3fae801a3714ac058c5d19edf7f2288c18e84195 (patch)
tree45832d82351c5094ccaca1e31fc5c7aa00067074 /cmd/podman/inspect/inspect.go
parent131458e956c74f7879223f278e8c3baf0ed925e9 (diff)
parent3ed56079f9483016d3aa3185f007a0063227fe09 (diff)
downloadpodman-3fae801a3714ac058c5d19edf7f2288c18e84195.tar.gz
podman-3fae801a3714ac058c5d19edf7f2288c18e84195.tar.bz2
podman-3fae801a3714ac058c5d19edf7f2288c18e84195.zip
Merge pull request #9313 from jwhonce/issues/8773
Add default template functions
Diffstat (limited to 'cmd/podman/inspect/inspect.go')
-rw-r--r--cmd/podman/inspect/inspect.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/cmd/podman/inspect/inspect.go b/cmd/podman/inspect/inspect.go
index 09721a2a8..351684af1 100644
--- a/cmd/podman/inspect/inspect.go
+++ b/cmd/podman/inspect/inspect.go
@@ -1,7 +1,6 @@
package inspect
import (
- "bytes"
"context"
"encoding/json" // due to a bug in json-iterator it cannot be used here
"fmt"
@@ -246,15 +245,8 @@ func printJSON(data []interface{}) error {
}
func printTmpl(typ, row string, data []interface{}) error {
- t, err := template.New(typ + " inspect").Funcs(map[string]interface{}{
- "json": func(v interface{}) string {
- b := &bytes.Buffer{}
- e := registry.JSONLibrary().NewEncoder(b)
- e.SetEscapeHTML(false)
- _ = e.Encode(v)
- return strings.TrimSpace(b.String())
- },
- }).Parse(row)
+ // We cannot use c/common/reports here, too many levels of interface{}
+ t, err := template.New(typ + " inspect").Funcs(template.FuncMap(report.DefaultFuncs)).Parse(row)
if err != nil {
return err
}