diff options
Diffstat (limited to 'cmd/podman/pods/ps.go')
-rw-r--r-- | cmd/podman/pods/ps.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/cmd/podman/pods/ps.go b/cmd/podman/pods/ps.go index 0271930e8..3e5ab86f4 100644 --- a/cmd/podman/pods/ps.go +++ b/cmd/podman/pods/ps.go @@ -6,14 +6,11 @@ import ( "os" "sort" "strings" - "text/tabwriter" - "text/template" "time" "github.com/containers/common/pkg/completion" "github.com/containers/common/pkg/report" "github.com/containers/podman/v3/cmd/podman/common" - "github.com/containers/podman/v3/cmd/podman/parse" "github.com/containers/podman/v3/cmd/podman/registry" "github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/pkg/domain/entities" @@ -131,20 +128,24 @@ func pods(cmd *cobra.Command, _ []string) error { renderHeaders := true row := podPsFormat() if cmd.Flags().Changed("format") { - renderHeaders = parse.HasTable(psInput.Format) + renderHeaders = report.HasTable(psInput.Format) row = report.NormalizeFormat(psInput.Format) } noHeading, _ := cmd.Flags().GetBool("noheading") if noHeading { renderHeaders = false } - format := parse.EnforceRange(row) + format := report.EnforceRange(row) - tmpl, err := template.New("listPods").Parse(format) + tmpl, err := report.NewTemplate("list").Parse(format) + if err != nil { + return err + } + + w, err := report.NewWriterDefault(os.Stdout) if err != nil { return err } - w := tabwriter.NewWriter(os.Stdout, 8, 2, 2, ' ', 0) defer w.Flush() if renderHeaders { |