aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-02-27 14:25:16 +0100
committerGitHub <noreply@github.com>2019-02-27 14:25:16 +0100
commit70d3cc2e73caf64fc978c1349da45c9a5551b210 (patch)
treea635aca13ac0e3aa95a784ae21b2ce37f19acd10 /cmd
parentf7f266e3618c6e4a9aa2c2c8c29ea40cf7087b0c (diff)
parentf68a243f8ee4d36990a50fa490dc427520dc8a14 (diff)
downloadpodman-70d3cc2e73caf64fc978c1349da45c9a5551b210.tar.gz
podman-70d3cc2e73caf64fc978c1349da45c9a5551b210.tar.bz2
podman-70d3cc2e73caf64fc978c1349da45c9a5551b210.zip
Merge pull request #2454 from mheon/all_your_defaults_belong_to_libpod
Move all storage configuration defaults into libpod
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/libpodruntime/runtime.go18
1 files changed, 12 insertions, 6 deletions
diff --git a/cmd/podman/libpodruntime/runtime.go b/cmd/podman/libpodruntime/runtime.go
index f4ddf3521..2b96f0c20 100644
--- a/cmd/podman/libpodruntime/runtime.go
+++ b/cmd/podman/libpodruntime/runtime.go
@@ -5,6 +5,7 @@ import (
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/pkg/rootless"
"github.com/containers/libpod/pkg/util"
+ "github.com/containers/storage"
"github.com/pkg/errors"
)
@@ -20,11 +21,8 @@ func GetRuntime(c *cliconfig.PodmanCommand) (*libpod.Runtime, error) {
func getRuntime(c *cliconfig.PodmanCommand, renumber bool) (*libpod.Runtime, error) {
options := []libpod.RuntimeOption{}
-
- storageOpts, _, err := util.GetDefaultStoreOptions()
- if err != nil {
- return nil, err
- }
+ storageOpts := storage.StoreOptions{}
+ storageSet := false
uidmapFlag := c.Flags().Lookup("uidmap")
gidmapFlag := c.Flags().Lookup("gidmap")
@@ -43,25 +41,33 @@ func getRuntime(c *cliconfig.PodmanCommand, renumber bool) (*libpod.Runtime, err
storageOpts.UIDMap = mappings.UIDMap
storageOpts.GIDMap = mappings.GIDMap
+ storageSet = true
}
if c.Flags().Changed("root") {
+ storageSet = true
storageOpts.GraphRoot = c.GlobalFlags.Root
}
if c.Flags().Changed("runroot") {
+ storageSet = true
storageOpts.RunRoot = c.GlobalFlags.Runroot
}
if len(storageOpts.RunRoot) > 50 {
return nil, errors.New("the specified runroot is longer than 50 characters")
}
if c.Flags().Changed("storage-driver") {
+ storageSet = true
storageOpts.GraphDriverName = c.GlobalFlags.StorageDriver
}
if len(c.GlobalFlags.StorageOpts) > 0 {
+ storageSet = true
storageOpts.GraphDriverOptions = c.GlobalFlags.StorageOpts
}
- options = append(options, libpod.WithStorageConfig(storageOpts))
+ // Only set this if the user changes storage config on the command line
+ if storageSet {
+ options = append(options, libpod.WithStorageConfig(storageOpts))
+ }
// TODO CLI flags for image config?
// TODO CLI flag for signature policy?