diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-03-27 20:55:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-27 20:55:48 +0100 |
commit | 3336b100ef3c1273df8ad3ebc44ce4738f8cf2c2 (patch) | |
tree | d085118d9cf28ed6a8a7b40c1bd6bb5b772b10cc /pkg/specgen/container_create.go | |
parent | 1fe2fbb42114b9072a1caf359beff63042df90fd (diff) | |
parent | 4352d585490f6c1eb7234ef4f92e0157083d69b3 (diff) | |
download | podman-3336b100ef3c1273df8ad3ebc44ce4738f8cf2c2.tar.gz podman-3336b100ef3c1273df8ad3ebc44ce4738f8cf2c2.tar.bz2 podman-3336b100ef3c1273df8ad3ebc44ce4738f8cf2c2.zip |
Merge pull request #4698 from rhatdan/containers.conf
Add support for containers.conf
Diffstat (limited to 'pkg/specgen/container_create.go')
-rw-r--r-- | pkg/specgen/container_create.go | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/pkg/specgen/container_create.go b/pkg/specgen/container_create.go index cf082441d..b4039bb91 100644 --- a/pkg/specgen/container_create.go +++ b/pkg/specgen/container_create.go @@ -4,9 +4,10 @@ import ( "context" "os" + "github.com/containers/common/pkg/config" "github.com/containers/libpod/libpod" - "github.com/containers/libpod/libpod/config" "github.com/containers/libpod/libpod/define" + "github.com/containers/storage" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -30,7 +31,7 @@ func (s *SpecGenerator) MakeContainer(rt *libpod.Runtime) (*libpod.Container, er if err != nil { return nil, err } - options = append(options, s.createExitCommandOption(rtc, podmanPath)) + options = append(options, s.createExitCommandOption(rt.StorageConfig(), rtc, podmanPath)) newImage, err := rt.ImageRuntime().NewFromLocal(s.Image) if err != nil { return nil, err @@ -148,7 +149,7 @@ func (s *SpecGenerator) createContainerOptions(rt *libpod.Runtime) ([]libpod.Ctr return options, nil } -func (s *SpecGenerator) createExitCommandOption(config *config.Config, podmanPath string) libpod.CtrCreateOption { +func (s *SpecGenerator) createExitCommandOption(storageConfig storage.StoreOptions, config *config.Config, podmanPath string) libpod.CtrCreateOption { // We need a cleanup process for containers in the current model. // But we can't assume that the caller is Podman - it could be another // user of the API. @@ -156,23 +157,23 @@ func (s *SpecGenerator) createExitCommandOption(config *config.Config, podmanPat // still invoke a cleanup process. command := []string{podmanPath, - "--root", config.StorageConfig.GraphRoot, - "--runroot", config.StorageConfig.RunRoot, + "--root", storageConfig.GraphRoot, + "--runroot", storageConfig.RunRoot, "--log-level", logrus.GetLevel().String(), - "--cgroup-manager", config.CgroupManager, - "--tmpdir", config.TmpDir, + "--cgroup-manager", config.Engine.CgroupManager, + "--tmpdir", config.Engine.TmpDir, } - if config.OCIRuntime != "" { - command = append(command, []string{"--runtime", config.OCIRuntime}...) + if config.Engine.OCIRuntime != "" { + command = append(command, []string{"--runtime", config.Engine.OCIRuntime}...) } - if config.StorageConfig.GraphDriverName != "" { - command = append(command, []string{"--storage-driver", config.StorageConfig.GraphDriverName}...) + if storageConfig.GraphDriverName != "" { + command = append(command, []string{"--storage-driver", storageConfig.GraphDriverName}...) } - for _, opt := range config.StorageConfig.GraphDriverOptions { + for _, opt := range storageConfig.GraphDriverOptions { command = append(command, []string{"--storage-opt", opt}...) } - if config.EventsLogger != "" { - command = append(command, []string{"--events-backend", config.EventsLogger}...) + if config.Engine.EventsLogger != "" { + command = append(command, []string{"--events-backend", config.Engine.EventsLogger}...) } // TODO Mheon wants to leave this for now |