summaryrefslogtreecommitdiff
path: root/cmd/podman/libpodruntime/runtime.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-04-23 20:42:53 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-04 17:15:55 +0000
commitb51d7379987581da82902027fe91cdf298047bc0 (patch)
treef9d7fbebf3b946caea5eb5e2c626a19413c795c8 /cmd/podman/libpodruntime/runtime.go
parent1f5debd43806cc3bd07f562ff00ef4c426540f98 (diff)
downloadpodman-b51d7379987581da82902027fe91cdf298047bc0.tar.gz
podman-b51d7379987581da82902027fe91cdf298047bc0.tar.bz2
podman-b51d7379987581da82902027fe91cdf298047bc0.zip
Begin wiring in USERNS Support into podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #690 Approved by: mheon
Diffstat (limited to 'cmd/podman/libpodruntime/runtime.go')
-rw-r--r--cmd/podman/libpodruntime/runtime.go37
1 files changed, 19 insertions, 18 deletions
diff --git a/cmd/podman/libpodruntime/runtime.go b/cmd/podman/libpodruntime/runtime.go
index f9c14f6e7..d1657325d 100644
--- a/cmd/podman/libpodruntime/runtime.go
+++ b/cmd/podman/libpodruntime/runtime.go
@@ -8,27 +8,28 @@ import (
// GetRuntime generates a new libpod runtime configured by command line options
func GetRuntime(c *cli.Context) (*libpod.Runtime, error) {
+ storageOpts := storage.DefaultStoreOptions
+ return GetRuntimeWithStorageOpts(c, &storageOpts)
+}
+
+// GetRuntime generates a new libpod runtime configured by command line options
+func GetRuntimeWithStorageOpts(c *cli.Context, storageOpts *storage.StoreOptions) (*libpod.Runtime, error) {
options := []libpod.RuntimeOption{}
- if c.GlobalIsSet("root") || c.GlobalIsSet("runroot") ||
- c.GlobalIsSet("storage-opt") || c.GlobalIsSet("storage-driver") {
- storageOpts := storage.DefaultStoreOptions
-
- if c.GlobalIsSet("root") {
- storageOpts.GraphRoot = c.GlobalString("root")
- }
- if c.GlobalIsSet("runroot") {
- storageOpts.RunRoot = c.GlobalString("runroot")
- }
- if c.GlobalIsSet("storage-driver") {
- storageOpts.GraphDriverName = c.GlobalString("storage-driver")
- }
- if c.GlobalIsSet("storage-opt") {
- storageOpts.GraphDriverOptions = c.GlobalStringSlice("storage-opt")
- }
-
- options = append(options, libpod.WithStorageConfig(storageOpts))
+ if c.GlobalIsSet("root") {
+ storageOpts.GraphRoot = c.GlobalString("root")
+ }
+ if c.GlobalIsSet("runroot") {
+ storageOpts.RunRoot = c.GlobalString("runroot")
}
+ if c.GlobalIsSet("storage-driver") {
+ storageOpts.GraphDriverName = c.GlobalString("storage-driver")
+ }
+ if c.GlobalIsSet("storage-opt") {
+ storageOpts.GraphDriverOptions = c.GlobalStringSlice("storage-opt")
+ }
+
+ options = append(options, libpod.WithStorageConfig(*storageOpts))
// TODO CLI flags for image config?
// TODO CLI flag for signature policy?