Don't return an ImageConfig when creating storage

We don't use it directly, we aren't going to cache it in the DB,
and when we do use it (image volumes) we might well be in a
different process (podman create -> podman start). No point in
keeping it around.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #571
Approved by: rhatdan
This commit is contained in:
Matthew Heon
2018-03-31 21:34:50 -04:00
committed by Atomic Bot
parent 4553f2914c
commit 48811d539e

View File

@ -7,7 +7,6 @@ import (
istorage "github.com/containers/image/storage"
"github.com/containers/image/types"
"github.com/containers/storage"
"github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
@ -29,7 +28,6 @@ func getStorageService(store storage.Store) (*storageService, error) {
type ContainerInfo struct {
Dir string
RunDir string
Config *v1.Image
}
// RuntimeContainerMetadata is the structure that we encode as JSON and store
@ -82,11 +80,6 @@ func (r *storageService) CreateContainerStorage(systemContext *types.SystemConte
}
defer image.Close()
imageConfig, err := image.OCIConfig()
if err != nil {
return ContainerInfo{}, err
}
// Update the image name and ID.
if imageName == "" && len(img.Names) > 0 {
imageName = img.Names[0]
@ -159,7 +152,6 @@ func (r *storageService) CreateContainerStorage(systemContext *types.SystemConte
return ContainerInfo{
Dir: containerDir,
RunDir: containerRunDir,
Config: imageConfig,
}, nil
}