diff options
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/common/create.go | 6 | ||||
-rw-r--r-- | cmd/podman/common/create_opts.go | 4 | ||||
-rw-r--r-- | cmd/podman/containers/create.go | 4 | ||||
-rw-r--r-- | cmd/podman/containers/prune.go | 4 | ||||
-rw-r--r-- | cmd/podman/images/prune.go | 4 | ||||
-rw-r--r-- | cmd/podman/networks/list.go | 14 | ||||
-rw-r--r-- | cmd/podman/networks/prune.go | 4 |
7 files changed, 19 insertions, 21 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index e95e447e1..3ce4e6731 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -97,7 +97,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions, cgroupsFlagName := "cgroups" createFlags.StringVar( - &cf.CGroupsMode, + &cf.CgroupsMode, cgroupsFlagName, cgroupConfig(), `control container cgroup configuration ("enabled"|"disabled"|"no-conmon"|"split")`, ) @@ -159,7 +159,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions, deviceCgroupRuleFlagName := "device-cgroup-rule" createFlags.StringSliceVar( - &cf.DeviceCGroupRule, + &cf.DeviceCgroupRule, deviceCgroupRuleFlagName, []string{}, "Add a rule to the cgroup allowed devices list", ) @@ -762,7 +762,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions, cgroupParentFlagName := "cgroup-parent" createFlags.StringVar( - &cf.CGroupParent, + &cf.CgroupParent, cgroupParentFlagName, "", "Optional parent cgroup for the container", ) diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index b4641ea96..eb0d07836 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -246,7 +246,7 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, rtc *c Authfile: "", CapAdd: append(capAdd, cc.HostConfig.CapAdd...), CapDrop: append(cappDrop, cc.HostConfig.CapDrop...), - CGroupParent: cc.HostConfig.CgroupParent, + CgroupParent: cc.HostConfig.CgroupParent, CIDFile: cc.HostConfig.ContainerIDFile, CPUPeriod: uint64(cc.HostConfig.CPUPeriod), CPUQuota: cc.HostConfig.CPUQuota, @@ -259,7 +259,7 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, rtc *c // Detach: false, // don't need // DetachKeys: "", // don't need Devices: devices, - DeviceCGroupRule: nil, + DeviceCgroupRule: nil, DeviceReadBPs: readBps, DeviceReadIOPs: readIops, DeviceWriteBPs: writeBps, diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go index 694b97fe5..db78c96ee 100644 --- a/cmd/podman/containers/create.go +++ b/cmd/podman/containers/create.go @@ -257,8 +257,8 @@ func CreateInit(c *cobra.Command, vals entities.ContainerCreateOptions, isInfra } vals.Env = env } - if c.Flag("cgroups").Changed && vals.CGroupsMode == "split" && registry.IsRemote() { - return vals, errors.Errorf("the option --cgroups=%q is not supported in remote mode", vals.CGroupsMode) + if c.Flag("cgroups").Changed && vals.CgroupsMode == "split" && registry.IsRemote() { + return vals, errors.Errorf("the option --cgroups=%q is not supported in remote mode", vals.CgroupsMode) } if c.Flag("pod").Changed && !strings.HasPrefix(c.Flag("pod").Value.String(), "new:") && c.Flag("userns").Changed { diff --git a/cmd/podman/containers/prune.go b/cmd/podman/containers/prune.go index e13b9e7f6..f58e37fd1 100644 --- a/cmd/podman/containers/prune.go +++ b/cmd/podman/containers/prune.go @@ -9,11 +9,11 @@ import ( "github.com/containers/common/pkg/completion" "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/utils" "github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/pkg/domain/entities" - "github.com/containers/podman/v3/pkg/specgenutil" "github.com/spf13/cobra" ) @@ -64,7 +64,7 @@ func prune(cmd *cobra.Command, args []string) error { } } - pruneOptions.Filters, err = specgenutil.ParseFilters(filter) + pruneOptions.Filters, err = parse.FilterArgumentsIntoFilters(filter) if err != nil { return err } diff --git a/cmd/podman/images/prune.go b/cmd/podman/images/prune.go index fc7451c41..e4c320a55 100644 --- a/cmd/podman/images/prune.go +++ b/cmd/podman/images/prune.go @@ -8,11 +8,11 @@ import ( "github.com/containers/common/pkg/completion" "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/utils" "github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/pkg/domain/entities" - "github.com/containers/podman/v3/pkg/specgenutil" "github.com/spf13/cobra" ) @@ -66,7 +66,7 @@ func prune(cmd *cobra.Command, args []string) error { return nil } } - filterMap, err := specgenutil.ParseFilters(filter) + filterMap, err := parse.FilterArgumentsIntoFilters(filter) if err != nil { return err } diff --git a/cmd/podman/networks/list.go b/cmd/podman/networks/list.go index b84c9f5d3..be61d72d8 100644 --- a/cmd/podman/networks/list.go +++ b/cmd/podman/networks/list.go @@ -10,10 +10,10 @@ import ( "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" - "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/pflag" ) @@ -61,14 +61,12 @@ func init() { } func networkList(cmd *cobra.Command, args []string) error { - networkListOptions.Filters = make(map[string][]string) - for _, f := range filters { - split := strings.SplitN(f, "=", 2) - if len(split) == 1 { - return errors.Errorf("invalid filter %q", f) - } - networkListOptions.Filters[split[0]] = append(networkListOptions.Filters[split[0]], split[1]) + var err error + networkListOptions.Filters, err = parse.FilterArgumentsIntoFilters(filters) + if err != nil { + return err } + responses, err := registry.ContainerEngine().NetworkList(registry.Context(), networkListOptions) if err != nil { return err diff --git a/cmd/podman/networks/prune.go b/cmd/podman/networks/prune.go index 311d098cd..e113cd359 100644 --- a/cmd/podman/networks/prune.go +++ b/cmd/podman/networks/prune.go @@ -7,11 +7,11 @@ import ( "strings" "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/utils" "github.com/containers/podman/v3/cmd/podman/validate" "github.com/containers/podman/v3/pkg/domain/entities" - "github.com/containers/podman/v3/pkg/specgenutil" "github.com/spf13/cobra" "github.com/spf13/pflag" ) @@ -68,7 +68,7 @@ func networkPrune(cmd *cobra.Command, _ []string) error { return nil } } - networkPruneOptions.Filters, err = specgenutil.ParseFilters(filter) + networkPruneOptions.Filters, err = parse.FilterArgumentsIntoFilters(filter) if err != nil { return err } |