summaryrefslogtreecommitdiff
path: root/libpod/image/image.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-03-13 17:17:07 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2019-03-29 08:27:33 -0400
commitc37589f503913ac85622cc9110e2eb983b1b38f3 (patch)
tree9061248749f167ec6a5674efa97fef55d2890a95 /libpod/image/image.go
parent6ab27c6355a4df228ed6d527162d5251d867b9b3 (diff)
downloadpodman-c37589f503913ac85622cc9110e2eb983b1b38f3.tar.gz
podman-c37589f503913ac85622cc9110e2eb983b1b38f3.tar.bz2
podman-c37589f503913ac85622cc9110e2eb983b1b38f3.zip
Set blob cache directory based on GraphDriver
Currently in rootless containers, we end up not using the blob cache. We also don't store the blob cache based on the users specified graph storage. This change will cause the cache directory to be stored with the rest of the containe images. While doing this patch, I found that we had duplicated GetSystemContext in two places in libpod. I cleaned this up. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r--libpod/image/image.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index f79bc3dc2..4862bf1d6 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -6,6 +6,7 @@ import (
"fmt"
"io"
"os"
+ "path/filepath"
"strings"
"syscall"
"time"
@@ -22,7 +23,6 @@ import (
"github.com/containers/image/transports"
"github.com/containers/image/transports/alltransports"
"github.com/containers/image/types"
- "github.com/containers/libpod/libpod/common"
"github.com/containers/libpod/libpod/driver"
"github.com/containers/libpod/libpod/events"
"github.com/containers/libpod/pkg/inspect"
@@ -548,6 +548,7 @@ func (i *Image) PushImageToHeuristicDestination(ctx context.Context, destination
// PushImageToReference pushes the given image to a location described by the given path
func (i *Image) PushImageToReference(ctx context.Context, dest types.ImageReference, manifestMIMEType, authFile, signaturePolicyPath string, writer io.Writer, forceCompress bool, signingOptions SigningOptions, dockerRegistryOptions *DockerRegistryOptions, additionalDockerArchiveTags []reference.NamedTagged) error {
sc := GetSystemContext(signaturePolicyPath, authFile, forceCompress)
+ sc.BlobInfoCacheDir = filepath.Join(i.imageruntime.store.GraphRoot(), "cache")
policyContext, err := getPolicyContext(sc)
if err != nil {
@@ -909,7 +910,7 @@ func (ir *Runtime) Import(ctx context.Context, path, reference string, writer io
return nil, errors.Wrapf(err, "error updating image config")
}
- sc := common.GetSystemContext("", "", false)
+ sc := GetSystemContext("", "", false)
// if reference not given, get the image digest
if reference == "" {