summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/images/list.go14
-rw-r--r--cmd/podman/images/prune.go6
-rw-r--r--cmd/podman/pods/create.go9
-rw-r--r--cmd/podman/system/service.go2
4 files changed, 19 insertions, 12 deletions
diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go
index 83c039ed3..022c90f71 100644
--- a/cmd/podman/images/list.go
+++ b/cmd/podman/images/list.go
@@ -85,7 +85,7 @@ func images(cmd *cobra.Command, args []string) error {
return errors.New("cannot specify an image and a filter(s)")
}
- if len(listOptions.Filter) < 1 && len(args) > 0 {
+ if len(args) > 0 {
listOptions.Filter = append(listOptions.Filter, "reference="+args[0])
}
@@ -152,10 +152,16 @@ func writeTemplate(imageS []*entities.ImageSummary) error {
)
imgs := make([]imageReporter, 0, len(imageS))
for _, e := range imageS {
- for _, tag := range e.RepoTags {
- var h imageReporter
+ var h imageReporter
+ if len(e.RepoTags) > 0 {
+ for _, tag := range e.RepoTags {
+ h.ImageSummary = *e
+ h.Repository, h.Tag = tokenRepoTag(tag)
+ imgs = append(imgs, h)
+ }
+ } else {
h.ImageSummary = *e
- h.Repository, h.Tag = tokenRepoTag(tag)
+ h.Repository = "<none>"
imgs = append(imgs, h)
}
listFlag.readOnly = e.IsReadOnly()
diff --git a/cmd/podman/images/prune.go b/cmd/podman/images/prune.go
index 7c9e3eb61..676382a99 100644
--- a/cmd/podman/images/prune.go
+++ b/cmd/podman/images/prune.go
@@ -61,12 +61,6 @@ Are you sure you want to continue? [y/N] `)
}
}
- // TODO Remove once filter refactor is finished and url.Values rules :)
- for _, f := range filter {
- t := strings.SplitN(f, "=", 2)
- pruneOpts.Filters.Add(t[0], t[1])
- }
-
results, err := registry.ImageEngine().Prune(registry.GetContext(), pruneOpts)
if err != nil {
return err
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go
index e24cdef98..62b5b849e 100644
--- a/cmd/podman/pods/create.go
+++ b/cmd/podman/pods/create.go
@@ -3,6 +3,7 @@ package pods
import (
"context"
"fmt"
+ "io/ioutil"
"os"
"strings"
@@ -12,7 +13,6 @@ import (
"github.com/containers/libpod/cmd/podman/validate"
"github.com/containers/libpod/pkg/domain/entities"
"github.com/containers/libpod/pkg/errorhandling"
- createconfig "github.com/containers/libpod/pkg/spec"
"github.com/containers/libpod/pkg/specgen"
"github.com/containers/libpod/pkg/util"
"github.com/pkg/errors"
@@ -60,7 +60,7 @@ func init() {
flags.StringVarP(&createOptions.Name, "name", "n", "", "Assign a name to the pod")
flags.StringVarP(&createOptions.Hostname, "hostname", "", "", "Set a hostname to the pod")
flags.StringVar(&podIDFile, "pod-id-file", "", "Write the pod ID to the file")
- flags.StringVar(&share, "share", createconfig.DefaultKernelNamespaces, "A comma delimited list of kernel namespaces the pod will share")
+ flags.StringVar(&share, "share", specgen.DefaultKernelNamespaces, "A comma delimited list of kernel namespaces the pod will share")
flags.SetNormalizeFunc(aliasNetworkFlag)
}
@@ -147,6 +147,11 @@ func create(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
+ if len(podIDFile) > 0 {
+ if err = ioutil.WriteFile(podIDFile, []byte(response.Id), 0644); err != nil {
+ return errors.Wrapf(err, "failed to write pod ID to file %q", podIDFile)
+ }
+ }
fmt.Println(response.Id)
return nil
}
diff --git a/cmd/podman/system/service.go b/cmd/podman/system/service.go
index 552c72f79..b5dd2f2aa 100644
--- a/cmd/podman/system/service.go
+++ b/cmd/podman/system/service.go
@@ -1,3 +1,5 @@
+// +build linux
+
package system
import (