diff options
author | umohnani8 <umohnani@redhat.com> | 2018-05-25 11:30:57 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-05-25 17:03:09 +0000 |
commit | 1930f5d7093e84cdcc9e327e296f4733f32b20c8 (patch) | |
tree | 4c41a5e955b12881dc7a88dae573a36dea9982ba /vendor/github.com/projectatomic/buildah/import.go | |
parent | 8fcf1aaa29e61b9305096f61a8ba26bc81462b05 (diff) | |
download | podman-1930f5d7093e84cdcc9e327e296f4733f32b20c8.tar.gz podman-1930f5d7093e84cdcc9e327e296f4733f32b20c8.tar.bz2 podman-1930f5d7093e84cdcc9e327e296f4733f32b20c8.zip |
Vendor in latest projectatomic/buildah
buildah fixed its probelm where it was not pulling in
the ENV of the base image. This pulls that change into
libpod as well.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #832
Approved by: mheon
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/import.go')
-rw-r--r-- | vendor/github.com/projectatomic/buildah/import.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/github.com/projectatomic/buildah/import.go b/vendor/github.com/projectatomic/buildah/import.go index 2a48d2c34..90b1b90b9 100644 --- a/vendor/github.com/projectatomic/buildah/import.go +++ b/vendor/github.com/projectatomic/buildah/import.go @@ -16,6 +16,7 @@ func importBuilderDataFromImage(ctx context.Context, store storage.Store, system manifest := []byte{} config := []byte{} imageName := "" + uidmap, gidmap := convertStorageIDMaps(storage.DefaultStoreOptions.UIDMap, storage.DefaultStoreOptions.GIDMap) if imageID != "" { ref, err := is.Transport.ParseStoreReference(store, imageID) @@ -39,6 +40,13 @@ func importBuilderDataFromImage(ctx context.Context, store storage.Store, system if len(img.Names) > 0 { imageName = img.Names[0] } + if img.TopLayer != "" { + layer, err4 := store.Layer(img.TopLayer) + if err4 != nil { + return nil, errors.Wrapf(err4, "error reading information about image's top layer") + } + uidmap, gidmap = convertStorageIDMaps(layer.UIDMap, layer.GIDMap) + } } } @@ -53,6 +61,13 @@ func importBuilderDataFromImage(ctx context.Context, store storage.Store, system ContainerID: containerID, ImageAnnotations: map[string]string{}, ImageCreatedBy: "", + NamespaceOptions: DefaultNamespaceOptions(), + IDMappingOptions: IDMappingOptions{ + HostUIDMapping: len(uidmap) == 0, + HostGIDMapping: len(uidmap) == 0, + UIDMap: uidmap, + GIDMap: gidmap, + }, } builder.initConfig() @@ -87,6 +102,7 @@ func importBuilder(ctx context.Context, store storage.Store, options ImportOptio if builder.FromImage != "" { builder.Docker.ContainerConfig.Image = builder.FromImage } + builder.IDMappingOptions.UIDMap, builder.IDMappingOptions.GIDMap = convertStorageIDMaps(c.UIDMap, c.GIDMap) err = builder.Save() if err != nil { |