diff options
author | baude <bbaude@redhat.com> | 2018-03-15 10:06:49 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-03-20 16:20:12 +0000 |
commit | 38a1b2f16d210525eafcc845e7a9cce598207113 (patch) | |
tree | 5616a12d68ebe55138fbde85f936a6bc90d4c8fd /libpod/runtime.go | |
parent | ecfa321288f10b70a59166f93296c77d262317fc (diff) | |
download | podman-38a1b2f16d210525eafcc845e7a9cce598207113.tar.gz podman-38a1b2f16d210525eafcc845e7a9cce598207113.tar.bz2 podman-38a1b2f16d210525eafcc845e7a9cce598207113.zip |
Image library stage 4 - create and commit
Migrate the podman create and commit subcommandis to leverage the images library. I also had
to migrate the cmd/ portions of run and rmi.
Signed-off-by: baude <bbaude@redhat.com>
Closes: #498
Approved by: mheon
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index cd519b3ab..5c3705ee9 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -13,6 +13,7 @@ import ( "github.com/containers/storage" "github.com/cri-o/ocicni/pkg/ocicni" "github.com/pkg/errors" + "github.com/projectatomic/libpod/libpod/image" "github.com/sirupsen/logrus" "github.com/ulule/deepcopier" ) @@ -69,6 +70,7 @@ type Runtime struct { conmonPath string valid bool lock sync.RWMutex + imageRuntime *image.Runtime } // RuntimeConfig contains configuration options used to set up the runtime @@ -194,11 +196,9 @@ func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) { return nil, errors.Wrapf(err, "error configuring runtime") } } - if err := makeRuntime(runtime); err != nil { return nil, err } - return runtime, nil } @@ -293,8 +293,20 @@ func makeRuntime(runtime *Runtime) error { if err != nil { return err } + runtime.store = store is.Transport.SetStore(store) + + // Set up image runtime and store in runtime + ir := image.NewImageRuntimeFromStore(runtime.store) + if err != nil { + return err + } + + runtime.imageRuntime = ir + + // Setting signaturepolicypath + ir.SignaturePolicyPath = runtime.config.SignaturePolicyPath defer func() { if err != nil { // Don't forcibly shut down @@ -576,3 +588,8 @@ func SaveDefaultConfig(path string) error { return ioutil.WriteFile(path, w.Bytes(), 0644) } + +// ImageRuntime returns the imageruntime for image resolution +func (r *Runtime) ImageRuntime() *image.Runtime { + return r.imageRuntime +} |