Commit Graph

7 Commits

Author SHA1 Message Date
Nalin Dahyabhai 02921ee3ab Fix ownership of content copied using COPY --from
COPY --from was incorrectly discarding ownership information on files
copied from other layers, which unlike content copied from the build
context, should not default to being owned by 0:0.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-08-22 13:22:48 -04:00
Nalin Dahyabhai 3835460c3b Use pipes for copying
Use the copier package to rework how we handle ADD and COPY.

When evaluating cache for content that's being copied/added in, switch
from (digest the data, check for a cache entry, then maybe copy the data
and create the new layer) to (copy the data and create the new layer,
digesting as we go, check for a cache entry, either commit or discard
the new layer).

Use the copier package for ADD, COPY, and for ensuring that a specified
directory exists in the working container's rootfs.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-08-21 12:34:00 -04:00
Sebastian Reuße 09138e29bc imagebuildah: don’t blank out destination names when COPYing
When ADDing an archive file, the destination file-name is blanked out to ensure
that archive contents are extracted in-place. However, when COPYing an
archive-file, we don’t want to blank out the destination filename.

Fixes: #2549

Signed-off-by: Sebastian Reuße <seb@wirrsal.net>
2020-08-16 12:39:18 +02:00
Nalin Dahyabhai 7f6ddecfdf conformance testing: ignore buildah.BuilderIdentityAnnotation labels
Ignore the buildah.BuilderIdentityAnnotation label when comparing images
that we build with images built using other tools, which of course don't
automatically set that label.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-08-12 11:25:52 -04:00
Nalin Dahyabhai 9fc9a222e7 conformance: add a test for COPY from subdirectory
Make sure we test copying from a subdirectory of the build context to a
new directory.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-08-06 13:18:17 -04:00
Nalin Dahyabhai e92358c8dc copier: split StripSetidBits into StripSetuidBit/StripSetgidBit/StripStickyBit
For the sake of conformance tests, callers need to be able to strip
setuid and setgid bits from contents being copied from the build context
while leaving the sticky bit intact.  Split the StripSetidBits option
for copier.Get() into three separate flags (StripSetuidBit /
StripSetgidBit / StripStickyBit).

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-07-29 02:11:11 -04:00
Nalin Dahyabhai 92e0c3fdcf Rework conformance testing
Move the conformance tests from ginkgo to using the default testing
package and github.com/stretchr/testify/require, preserving the existing
tests and adding more.

Add conformance tests to our Cirrus configuration, currently marked as
an allowed failure.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-07-23 15:30:58 -04:00