diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2017-12-19 09:07:49 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-12-19 18:51:52 +0000 |
commit | 94a810751539afeb1590ccc1a9745f1d5767fda2 (patch) | |
tree | 0e143bd90c976c60db4f0435d12c6266e0fe3e72 /cmd/podman/create.go | |
parent | c0432eb0e8a2c777a5c6d8caa01475c06553594c (diff) | |
download | podman-94a810751539afeb1590ccc1a9745f1d5767fda2.tar.gz podman-94a810751539afeb1590ccc1a9745f1d5767fda2.tar.bz2 podman-94a810751539afeb1590ccc1a9745f1d5767fda2.zip |
Add support for adding devices to container
Also add --quiet option to kpod create/run since
this will help with writing tests.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #140
Approved by: TomSweeneyRedHat
Diffstat (limited to 'cmd/podman/create.go')
-rw-r--r-- | cmd/podman/create.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cmd/podman/create.go b/cmd/podman/create.go index f65bc49c6..79f08220d 100644 --- a/cmd/podman/create.go +++ b/cmd/podman/create.go @@ -3,6 +3,7 @@ package main import ( "encoding/json" "fmt" + "io" "os" "strconv" "strings" @@ -14,7 +15,6 @@ import ( "github.com/projectatomic/libpod/libpod" "github.com/sirupsen/logrus" "github.com/urfave/cli" - pb "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime" ) type mountType string @@ -72,7 +72,7 @@ type createConfig struct { CgroupParent string // cgroup-parent Command []string Detach bool // detach - Devices []*pb.Device // device + Devices []string // device DNSOpt []string //dns-opt DNSSearch []string //dns-search DNSServers []string //dns @@ -101,6 +101,7 @@ type createConfig struct { Privileged bool //privileged Publish []string //publish PublishAll bool //publish-all + Quiet bool //quiet ReadOnlyRootfs bool //read-only Resources createResourceConfig Rm bool //rm @@ -167,8 +168,11 @@ func createCmd(c *cli.Context) error { if createImage.LocalName == "" { // The image wasnt found by the user input'd name or its fqname // Pull the image - fmt.Printf("Trying to pull %s...", createImage.PullName) - createImage.Pull() + var writer io.Writer + if !createConfig.Quiet { + writer = os.Stdout + } + createImage.Pull(writer) } runtimeSpec, err := createConfigToOCISpec(createConfig) @@ -419,6 +423,7 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime) (*createConfig, er CgroupParent: c.String("cgroup-parent"), Command: command, Detach: c.Bool("detach"), + Devices: c.StringSlice("device"), DNSOpt: c.StringSlice("dns-opt"), DNSSearch: c.StringSlice("dns-search"), DNSServers: c.StringSlice("dns"), @@ -447,6 +452,7 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime) (*createConfig, er Privileged: c.Bool("privileged"), Publish: c.StringSlice("publish"), PublishAll: c.Bool("publish-all"), + Quiet: c.Bool("quiet"), ReadOnlyRootfs: c.Bool("read-only"), Resources: createResourceConfig{ BlkioWeight: blkioWeight, |