summaryrefslogtreecommitdiff
path: root/cmd/podman/libpodruntime
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-12-05 00:55:48 -0800
committerGitHub <noreply@github.com>2018-12-05 00:55:48 -0800
commit50e754cd579933ba887927f4ff05754ad926eb30 (patch)
tree29a5e5b28a89e0d23ae32cbf43a911fa6b9b8479 /cmd/podman/libpodruntime
parent320085a04d6db82421cf6c2870071ab2cb54d22b (diff)
parente3882cfa2d1329d44c8a580418ea1d56804b331d (diff)
downloadpodman-50e754cd579933ba887927f4ff05754ad926eb30.tar.gz
podman-50e754cd579933ba887927f4ff05754ad926eb30.tar.bz2
podman-50e754cd579933ba887927f4ff05754ad926eb30.zip
Merge pull request #1918 from mheon/use_db_paths
Use paths written in DB instead if they differ from our defaults
Diffstat (limited to 'cmd/podman/libpodruntime')
-rw-r--r--cmd/podman/libpodruntime/runtime.go34
1 files changed, 10 insertions, 24 deletions
diff --git a/cmd/podman/libpodruntime/runtime.go b/cmd/podman/libpodruntime/runtime.go
index f69eaf3a4..0dc6bcf18 100644
--- a/cmd/podman/libpodruntime/runtime.go
+++ b/cmd/podman/libpodruntime/runtime.go
@@ -11,32 +11,18 @@ import (
// GetRuntime generates a new libpod runtime configured by command line options
func GetRuntime(c *cli.Context) (*libpod.Runtime, error) {
- storageOpts, err := util.GetDefaultStoreOptions()
- if err != nil {
- return nil, err
- }
- return GetRuntimeWithStorageOpts(c, &storageOpts)
-}
-
-// GetContainerRuntime generates a new libpod runtime configured by command line options for containers
-func GetContainerRuntime(c *cli.Context) (*libpod.Runtime, error) {
- mappings, err := util.ParseIDMapping(c.StringSlice("uidmap"), c.StringSlice("gidmap"), c.String("subuidmap"), c.String("subgidmap"))
- if err != nil {
- return nil, err
- }
- storageOpts, err := util.GetDefaultStoreOptions()
- if err != nil {
- return nil, err
- }
- storageOpts.UIDMap = mappings.UIDMap
- storageOpts.GIDMap = mappings.GIDMap
- 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) {
+ storageOpts := new(storage.StoreOptions)
options := []libpod.RuntimeOption{}
+ if c.IsSet("uidmap") || c.IsSet("gidmap") || c.IsSet("subuidmap") || c.IsSet("subgidmap") {
+ mappings, err := util.ParseIDMapping(c.StringSlice("uidmap"), c.StringSlice("gidmap"), c.String("subuidmap"), c.String("subgidmap"))
+ if err != nil {
+ return nil, err
+ }
+ storageOpts.UIDMap = mappings.UIDMap
+ storageOpts.GIDMap = mappings.GIDMap
+ }
+
if c.GlobalIsSet("root") {
storageOpts.GraphRoot = c.GlobalString("root")
}