summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-01-08 12:34:40 +0100
committerValentin Rothberg <rothberg@redhat.com>2019-01-08 12:34:40 +0100
commit454ad71fd46035d0e4f005f0188bc38a51ec0ee7 (patch)
treeb359bbf1da8d7016395261c2f3a273d59f4b716d /vendor
parentfaa24627bb19d67b0e7a681673deb58922a634c1 (diff)
downloadpodman-454ad71fd46035d0e4f005f0188bc38a51ec0ee7.tar.gz
podman-454ad71fd46035d0e4f005f0188bc38a51ec0ee7.tar.bz2
podman-454ad71fd46035d0e4f005f0188bc38a51ec0ee7.zip
vendor latest buildah
Allow parallel copying from the blobcache. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor')
-rw-r--r--vendor/github.com/containers/buildah/imagebuildah/build.go1
-rw-r--r--vendor/github.com/containers/buildah/pkg/blobcache/blobcache.go20
2 files changed, 16 insertions, 5 deletions
diff --git a/vendor/github.com/containers/buildah/imagebuildah/build.go b/vendor/github.com/containers/buildah/imagebuildah/build.go
index d838260e7..217bcfc79 100644
--- a/vendor/github.com/containers/buildah/imagebuildah/build.go
+++ b/vendor/github.com/containers/buildah/imagebuildah/build.go
@@ -517,6 +517,7 @@ func (b *Executor) Run(run imagebuilder.Run, config docker.Config) error {
Hostname: config.Hostname,
Runtime: b.runtime,
Args: b.runtimeArgs,
+ NoPivot: os.Getenv("BUILDAH_NOPIVOT") != "",
Mounts: convertMounts(b.transientMounts),
Env: config.Env,
User: config.User,
diff --git a/vendor/github.com/containers/buildah/pkg/blobcache/blobcache.go b/vendor/github.com/containers/buildah/pkg/blobcache/blobcache.go
index ae55316b0..31e6a428c 100644
--- a/vendor/github.com/containers/buildah/pkg/blobcache/blobcache.go
+++ b/vendor/github.com/containers/buildah/pkg/blobcache/blobcache.go
@@ -52,14 +52,18 @@ type BlobCache interface {
type blobCacheReference struct {
reference types.ImageReference
+ // WARNING: The contents of this directory may be accessed concurrently,
+ // both within this process and by multiple different processes
directory string
compress types.LayerCompression
}
type blobCacheSource struct {
- reference *blobCacheReference
- source types.ImageSource
- sys types.SystemContext
+ reference *blobCacheReference
+ source types.ImageSource
+ sys types.SystemContext
+ // this mutex synchronizes the counters below
+ mu sync.Mutex
cacheHits int64
cacheMisses int64
cacheErrors int64
@@ -219,7 +223,7 @@ func (s *blobCacheSource) GetManifest(ctx context.Context, instanceDigest *diges
}
func (s *blobCacheSource) HasThreadSafeGetBlob() bool {
- return false
+ return s.source.HasThreadSafeGetBlob()
}
func (s *blobCacheSource) GetBlob(ctx context.Context, blobinfo types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) {
@@ -232,16 +236,22 @@ func (s *blobCacheSource) GetBlob(ctx context.Context, blobinfo types.BlobInfo,
filename := filepath.Join(s.reference.directory, makeFilename(blobinfo.Digest, isConfig))
f, err := os.Open(filename)
if err == nil {
+ s.mu.Lock()
s.cacheHits++
+ s.mu.Unlock()
return f, size, nil
}
if !os.IsNotExist(err) {
+ s.mu.Lock()
s.cacheErrors++
+ s.mu.Unlock()
return nil, -1, errors.Wrapf(err, "error checking for cache file %q", filepath.Join(s.reference.directory, filename))
}
}
}
+ s.mu.Lock()
s.cacheMisses++
+ s.mu.Unlock()
rc, size, err := s.source.GetBlob(ctx, blobinfo, cache)
if err != nil {
return rc, size, errors.Wrapf(err, "error reading blob from source image %q", transports.ImageName(s.reference))
@@ -403,7 +413,7 @@ func saveStream(wg *sync.WaitGroup, decompressReader io.ReadCloser, tempFile *os
}
func (s *blobCacheDestination) HasThreadSafePutBlob() bool {
- return false
+ return s.destination.HasThreadSafePutBlob()
}
func (d *blobCacheDestination) PutBlob(ctx context.Context, stream io.Reader, inputInfo types.BlobInfo, cache types.BlobInfoCache, isConfig bool) (types.BlobInfo, error) {