Commit Graph

7 Commits

Author SHA1 Message Date
Daniel J Walsh 8d5d763213
Fix stutters
Podman adds an Error: to every error message. So starting an error
message with "error" ends up being reported to the user as

Error: error ...

This patch removes the stutter.

Also ioutil.ReadFile errors report the Path, so wrapping the err message
with the path causes a stutter.

Signed-off-by: Daniel J Walsh dwalsh@redhat.com

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-19 07:11:44 -04:00
Sascha Grunert ce384684c0
Switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-07 11:41:47 +02:00
Nalin Dahyabhai 0bfbd3edb7 newTarDigester: zero out timestamps in tar headers
When digesting tar streams, zero out timestamps in headers before
digesting them.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-08-22 13:16:19 -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
Nalin Dahyabhai bee80f0e36 tarFilterer: handle multiple archives
When processing .dockerignore files, we produce mini-archives for each
individual item being copied as part of a directory tree, so if we pass
them through a tarFilterer, it needs to not give up when it hits the end
of the first archive that it sees.

Add a flag to the tarFilterer that it sets when it closes the writing
end of the pipe that it's reading, and if the flag isn't set when the
reader finds an EOF, have the reader gear up to read another archive
instead of just refusing to process any more data.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-07-28 15:51:36 -04:00
Nalin Dahyabhai aad1fc5878 CompositeDigester: add the ability to filter tar streams
Rework CompositeDigester so that it can handle type "".
Add a newTarFilterer() inspired by imagebuilder's, that we'll be able to
use to adjust headers before digesting them.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-07-17 12:07:39 -04:00
Nalin Dahyabhai ebf6f518d0 Use content digests in ADD/COPY history entries
Use digests of the added content in history entries that we create for
ADD and COPY instructions, tightening up cache checking just a little
bit more.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #1792
Approved by: TomSweeneyRedHat
2019-08-16 20:16:40 +00:00