Commit Graph

13 Commits

Author SHA1 Message Date
Miloslav Trmač f468eee1e9 Inline ReadFooterDataFromAnnotations into the only caller
Again, decrease the size of the compression code for c/image.

We will simplify this further immediately.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-04-22 23:56:40 +02:00
Miloslav Trmač ea3e384742 Don't look for the binary digest when pulling layers
This code path is usually never triggered because
the annotations are present; and it was broken until recently.

Remove it to simplify the code and analysis.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-04-22 23:56:40 +02:00
Miloslav Trmač e750609e98 Remove ChecksumAnntation from ZstdChunkedFooterData
Manage the value directly to simplify.

This happens to fix the ReadFooterDataFromBlob code path,
which was not setting ChecksumAnntation at all.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-04-13 16:57:14 +02:00
Miloslav Trmač 29bca8a07e Only obtain the zstd:chunked TOC digest once
Make it structually clear that the code is all using the same value,
making it less likely for the verifier and other uses to get out of sync.

Also avoids some redundant parsing and error paths.
The conversion path looks longer, but that's just moving the parsing
from the called function (which is redundant for other callers).

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-04-13 16:57:07 +02:00
Miloslav Trmač b90f9dfed8 Only obtain the estargz TOC digest once
Make it structually clear that the code is all using the same value,
making it less likely for the verifier and other uses to get out of sync.

Also avoids some redundant parsing and error paths.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-04-13 16:26:32 +02:00
Miloslav Trmač bbe282085b Rename a misleading parameter
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2024-02-26 21:06:37 +01:00
Giuseppe Scrivano 2c0ba1a132 chunked: refactor code in new functions
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-09-05 08:55:29 +02:00
Giuseppe Scrivano c98840f31d chunked: support converting existing images
if the "convert_images" option is set in the configuration file, then
convert traditional images to the chunked format on the fly.

This is very expensive at the moment since the entire zstd:chunked
file is created and then processed.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-07-26 10:46:15 +02:00
Giuseppe Scrivano 97da4fcf8e chunked: drop support for uncompressed metadata blobs
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-06-17 00:31:40 +02:00
Giuseppe Scrivano 8ef163a990 chunked: generate tar-split as part of zstd:chunked
change the file format to store the tar-split as part of the
zstd:chunked image.  This will allow clients to rebuild the entire
tarball without having to download it fully.

also store the uncompressed digest for the tarball, so that it can be
stored into the storage database.

Needs: https://github.com/containers/image/pull/1976

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-06-17 00:31:39 +02:00
Daniel J Walsh 1bf0078883 Move to golang 1.18 and later
Github.com is reporting security issues on older versions of
golang.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-03 15:26:54 -04:00
Giuseppe Scrivano 5af655e543 chunked: use io.github.containers
we do not own containers.io so let's use io.github.containers, since
the project is part of the containers organization under github.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-11-03 12:48:45 +01:00
Miloslav Trmač c486e1ac82 Move code only called on Linux into a Linux-specific file
Only moves unchanged code, should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-10-14 17:17:53 +02:00