From bab3cda0e81fa3ac3315601f5ec17724f3ad8ed5 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Tue, 20 Oct 2020 10:29:49 -0700 Subject: Refactor podman to use c/common/pkg/report All formatting for containers stack moved into one package The does not correct issue with headers when using custom tables Signed-off-by: Jhon Honce --- cmd/podman/networks/create.go | 4 ++-- cmd/podman/networks/inspect.go | 5 ++--- cmd/podman/networks/list.go | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'cmd/podman/networks') diff --git a/cmd/podman/networks/create.go b/cmd/podman/networks/create.go index 17f39bd8b..d32225aa7 100644 --- a/cmd/podman/networks/create.go +++ b/cmd/podman/networks/create.go @@ -34,9 +34,9 @@ func networkCreateFlags(flags *pflag.FlagSet) { flags.IPNetVar(&networkCreateOptions.Range, "ip-range", net.IPNet{}, "allocate container IP from range") flags.StringVar(&networkCreateOptions.MacVLAN, "macvlan", "", "create a Macvlan connection based on this device") // TODO not supported yet - //flags.StringVar(&networkCreateOptions.IPamDriver, "ipam-driver", "", "IP Address Management Driver") + // flags.StringVar(&networkCreateOptions.IPamDriver, "ipam-driver", "", "IP Address Management Driver") // TODO enable when IPv6 is working - //flags.BoolVar(&networkCreateOptions.IPV6, "IPv6", false, "enable IPv6 networking") + // flags.BoolVar(&networkCreateOptions.IPV6, "IPv6", false, "enable IPv6 networking") flags.IPNetVar(&networkCreateOptions.Subnet, "subnet", net.IPNet{}, "subnet in CIDR format") flags.BoolVar(&networkCreateOptions.DisableDNS, "disable-dns", false, "disable dns plugin") } diff --git a/cmd/podman/networks/inspect.go b/cmd/podman/networks/inspect.go index c36125948..29131cd28 100644 --- a/cmd/podman/networks/inspect.go +++ b/cmd/podman/networks/inspect.go @@ -7,9 +7,8 @@ import ( "text/tabwriter" "text/template" - "github.com/containers/podman/v2/cmd/podman/parse" + "github.com/containers/common/pkg/report" "github.com/containers/podman/v2/cmd/podman/registry" - "github.com/containers/podman/v2/cmd/podman/report" "github.com/containers/podman/v2/pkg/domain/entities" "github.com/spf13/cobra" ) @@ -47,7 +46,7 @@ func networkInspect(_ *cobra.Command, args []string) error { } switch { - case parse.MatchesJSONFormat(networkInspectOptions.Format) || networkInspectOptions.Format == "": + case report.IsJSON(networkInspectOptions.Format) || networkInspectOptions.Format == "": b, err := json.MarshalIndent(responses, "", " ") if err != nil { return err diff --git a/cmd/podman/networks/list.go b/cmd/podman/networks/list.go index c53f50c9f..cb70d5218 100644 --- a/cmd/podman/networks/list.go +++ b/cmd/podman/networks/list.go @@ -36,7 +36,7 @@ var ( func networkListFlags(flags *pflag.FlagSet) { // TODO enable filters based on something - //flags.StringSliceVarP(&networklistCommand.Filter, "filter", "f", []string{}, "Pause all running containers") + // flags.StringSliceVarP(&networklistCommand.Filter, "filter", "f", []string{}, "Pause all running containers") flags.StringVarP(&networkListOptions.Format, "format", "f", "", "Pretty-print networks to JSON or using a Go template") flags.BoolVarP(&networkListOptions.Quiet, "quiet", "q", false, "display only names") flags.StringVarP(&networkListOptions.Filter, "filter", "", "", "Provide filter values (e.g. 'name=podman')") -- cgit v1.2.3-54-g00ecf