summaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/add.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-09-14 22:25:08 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-09-15 10:58:55 +0000
commit5e4f7e915ebec279f20329bba5701a7b8d8dfe32 (patch)
tree92cd8bbf3ed49cca9cf8b46322bfe57848bd39c4 /vendor/github.com/projectatomic/buildah/add.go
parent70189f0223cc01a2949cea436e06f3aee316d0db (diff)
downloadpodman-5e4f7e915ebec279f20329bba5701a7b8d8dfe32.tar.gz
podman-5e4f7e915ebec279f20329bba5701a7b8d8dfe32.tar.bz2
podman-5e4f7e915ebec279f20329bba5701a7b8d8dfe32.zip
Vendor in latest projectatomic/buildah
Buildah Fixes to COPY and ADD to properly follow symbolic links is SRC is a symbolic link Print out a digest message on successful push. We should not drop the Bounding set when running as a non priv user in podman build Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1483 Approved by: rhatdan
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/add.go')
-rw-r--r--vendor/github.com/projectatomic/buildah/add.go28
1 files changed, 16 insertions, 12 deletions
diff --git a/vendor/github.com/projectatomic/buildah/add.go b/vendor/github.com/projectatomic/buildah/add.go
index 1aad8ad37..27c07c323 100644
--- a/vendor/github.com/projectatomic/buildah/add.go
+++ b/vendor/github.com/projectatomic/buildah/add.go
@@ -168,9 +168,13 @@ func (b *Builder) Add(destination string, extract bool, options AddAndCopyOption
return errors.Wrapf(syscall.ENOENT, "no files found matching %q", src)
}
for _, gsrc := range glob {
- srcfi, err := os.Stat(gsrc)
+ esrc, err := filepath.EvalSymlinks(gsrc)
if err != nil {
- return errors.Wrapf(err, "error reading %q", gsrc)
+ return errors.Wrapf(err, "error evaluating symlinks %q", gsrc)
+ }
+ srcfi, err := os.Stat(esrc)
+ if err != nil {
+ return errors.Wrapf(err, "error reading %q", esrc)
}
if srcfi.IsDir() {
// The source is a directory, so copy the contents of
@@ -180,13 +184,13 @@ func (b *Builder) Add(destination string, extract bool, options AddAndCopyOption
if err = idtools.MkdirAllAndChownNew(dest, 0755, hostOwner); err != nil {
return err
}
- logrus.Debugf("copying %q to %q", gsrc+string(os.PathSeparator)+"*", dest+string(os.PathSeparator)+"*")
- if err := copyWithTar(gsrc, dest); err != nil {
- return errors.Wrapf(err, "error copying %q to %q", gsrc, dest)
+ logrus.Debugf("copying %q to %q", esrc+string(os.PathSeparator)+"*", dest+string(os.PathSeparator)+"*")
+ if err := copyWithTar(esrc, dest); err != nil {
+ return errors.Wrapf(err, "error copying %q to %q", esrc, dest)
}
continue
}
- if !extract || !archive.IsArchivePath(gsrc) {
+ if !extract || !archive.IsArchivePath(esrc) {
// This source is a file, and either it's not an
// archive, or we don't care whether or not it's an
// archive.
@@ -195,16 +199,16 @@ func (b *Builder) Add(destination string, extract bool, options AddAndCopyOption
d = filepath.Join(dest, filepath.Base(gsrc))
}
// Copy the file, preserving attributes.
- logrus.Debugf("copying %q to %q", gsrc, d)
- if err := copyFileWithTar(gsrc, d); err != nil {
- return errors.Wrapf(err, "error copying %q to %q", gsrc, d)
+ logrus.Debugf("copying %q to %q", esrc, d)
+ if err := copyFileWithTar(esrc, d); err != nil {
+ return errors.Wrapf(err, "error copying %q to %q", esrc, d)
}
continue
}
// We're extracting an archive into the destination directory.
- logrus.Debugf("extracting contents of %q into %q", gsrc, dest)
- if err := untarPath(gsrc, dest); err != nil {
- return errors.Wrapf(err, "error extracting %q into %q", gsrc, dest)
+ logrus.Debugf("extracting contents of %q into %q", esrc, dest)
+ if err := untarPath(esrc, dest); err != nil {
+ return errors.Wrapf(err, "error extracting %q into %q", esrc, dest)
}
}
}