Commit Graph

3164 Commits

Author SHA1 Message Date
Miloslav Trmač b80addc01c
Merge pull request #1549 from Jamstah/gobin-fix
Use go env to fetch the go path
2022-05-11 19:49:46 +02:00
James Hewitt aa6d7d9ea5
Use go env to fetch the go path
If both GOBIN and GOPATH aren't set in the system environment then the
makefile will attempt to install to /bin. go env uses a sensible default
of $HOME/go if GOPATH isn't set.

Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
2022-05-11 15:27:16 +01:00
Giuseppe Scrivano 6ef30ef088
docker: validate received parts
validate that the server returns the number of chunks we requested.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-05-11 15:19:46 +02:00
Daniel J Walsh 0ef069506c
Merge pull request #1544 from dfr/freebsd
Config files should live in /usr/local on FreeBSD
2022-05-10 10:11:20 -04:00
Doug Rabson 607cca6b19 Config files should live in /usr/local on FreeBSD
Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-05-10 10:45:49 +01:00
Daniel J Walsh a75b3da559
Merge pull request #1545 from containers/dependabot/go_modules/github.com/klauspost/compress-1.15.3
build(deps): bump github.com/klauspost/compress from 1.15.2 to 1.15.3
2022-05-09 09:44:12 -04:00
Daniel J Walsh 0562e1909a
Merge pull request #1543 from containers/dependabot/go_modules/github.com/docker/docker-20.10.15incompatible
build(deps): bump github.com/docker/docker from 20.10.14+incompatible to 20.10.15+incompatible
2022-05-09 09:43:50 -04:00
dependabot[bot] 01f36ef444
build(deps): bump github.com/klauspost/compress from 1.15.2 to 1.15.3
Bumps [github.com/klauspost/compress](https://github.com/klauspost/compress) from 1.15.2 to 1.15.3.
- [Release notes](https://github.com/klauspost/compress/releases)
- [Changelog](https://github.com/klauspost/compress/blob/master/.goreleaser.yml)
- [Commits](https://github.com/klauspost/compress/compare/v1.15.2...v1.15.3)

---
updated-dependencies:
- dependency-name: github.com/klauspost/compress
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 08:16:42 +00:00
dependabot[bot] 0a9935c841
build(deps): bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.14+incompatible to 20.10.15+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Changelog](https://github.com/moby/moby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/docker/docker/compare/v20.10.14...v20.10.15)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-06 08:15:16 +00:00
Miloslav Trmač f0e3254e7b
Merge pull request #1538 from containers/dependabot/go_modules/github.com/containers/storage-1.40.2
build(deps): bump github.com/containers/storage from 1.40.0 to 1.40.2
2022-05-04 23:53:05 +02:00
dependabot[bot] 2a32dd0b12
build(deps): bump github.com/containers/storage from 1.40.0 to 1.40.2
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.40.0 to 1.40.2.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/main/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.40.0...v1.40.2)

---
updated-dependencies:
- dependency-name: github.com/containers/storage
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-04 20:56:41 +00:00
Daniel J Walsh d18dcbcad9
Merge pull request #1541 from mtrmac/makefile-unused
Remove unused Makefile variables
2022-05-04 16:52:03 -04:00
Miloslav Trmač c2b7df8183 Remove unused Makefile variables
The Skopeo branch to test against is now driven by
SKOPEO_CI_TAG in .cirrus.yml, these are not used by anything.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-05-04 21:09:57 +02:00
Daniel J Walsh 269ffff7b1
Merge pull request #1537 from mtrmac/release-5.21.1
Release 5.21.1
2022-05-02 15:09:05 -04:00
Daniel J Walsh 31dc006650 Move to v5.21.2-dev
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-05-02 20:40:36 +02:00
Daniel J Walsh 3535abd765 Bump to v5.21.1
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-05-02 20:40:36 +02:00
Daniel J Walsh bd30434879 Update vendor to containers/storage v1.40.0
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-05-02 20:40:18 +02:00
Daniel J Walsh 7f8c6e0036
Merge pull request #1533 from mtrmac/uncompressed-reuse
Fix unwanted reuse of encrypted layers
2022-05-01 13:06:47 -04:00
Miloslav Trmač d1d16ebe49 Avoid calls to RecordDigestUncompressedPair that involve encrypted data
Operations that involve encryption/decryption are already restricted
e.g. not to use TryReusingBlob; but operations that don't themselves
involve encryption could still find encrypted blobs in the blob info cache,
and potentially use them in other contexts.

To avoid that, use a somewhat big hammer of just not calling
RecordDigestUncompressedPair on that.  Note that this does not
help if the blob info cache has already added such entries before this
change; it only makes a difference for the future.

We continue to call RecordKnownLocation with encrypted data; simple
copies of encrypted images from one registry to another (which don't
encrypt/decrypt as part of the copy) can benefit from e.g. cross-repo
blob reuse just fine.

It seems likely that a more precise logic which records more data
and allows more blob reuse could be built, but it's not trivially
obvious to me that it would be safe, so this change only does the
conservative thing to avoid known breakage.

There is another RecordDigestUncompressedPair call in c/image/storage;
that one is safe, because it only works on a pair of unencrypted
digests (for a compressed layer, PutBlobWithOptions receives an empty
digest value, and a necessarily decrypted data stream; using that,
it computes is own digests of the decrypted possibly-compressed
and unencrypted uncommpressed data streams).

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-30 00:21:14 +02:00
Miloslav Trmač 1cb66535b0 Don't require DiffID computation when encryption is involved
AFAICS encryption doesn't _actually_ need diffIDs, at least I
can't see any encryption-related use of the computed value; the boolean
seems to only be set to avoid reuse (which risks unwanted reuse of
plaintext data, or revealing relationships between ciphertext/plaintext
to network observers).

So, use two extra variables to be clear about the logic of the code.

(Also reorder one condition to check a local variable first before calling
methods, a microoptimizaion.)

Should not change outcome of the operation (but the time and CPU usage
no longer spent to unnecessarily compute DiffID values might be noticeable).

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-30 00:21:14 +02:00
Miloslav Trmač f01b06f956
Merge pull request #1534 from lsm5/main-bump-ocicrypt
Bump github.com/containers/ocicrypt to 566b808
2022-04-29 20:57:08 +02:00
Lokesh Mandvekar ee9ce71bbc
Bump github.com/containers/ocicrypt to 566b808
The two latest commits in c/ocicrypt get rid of OAEPDefaultHash envvar
and default to sha256.

They are waiting for confirmation on their rust side before cutting a
release. So, hoping to get this in assuming dependabot could take a
while.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2022-04-29 14:30:02 -04:00
Chris Evich 90eec841df Cirrus: Update to F36 VMs
Signed-off-by: Chris Evich <cevich@redhat.com>
2022-04-29 14:29:16 -04:00
Miloslav Trmač 0d80718f58
Merge pull request #1531 from containers/dependabot/go_modules/github.com/klauspost/compress-1.15.2
build(deps): bump github.com/klauspost/compress from 1.15.1 to 1.15.2
2022-04-27 18:53:17 +02:00
dependabot[bot] d00bca73d8
build(deps): bump github.com/klauspost/compress from 1.15.1 to 1.15.2
Bumps [github.com/klauspost/compress](https://github.com/klauspost/compress) from 1.15.1 to 1.15.2.
- [Release notes](https://github.com/klauspost/compress/releases)
- [Changelog](https://github.com/klauspost/compress/blob/master/.goreleaser.yml)
- [Commits](https://github.com/klauspost/compress/compare/v1.15.1...v1.15.2)

---
updated-dependencies:
- dependency-name: github.com/klauspost/compress
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-27 16:36:35 +00:00
Miloslav Trmač 50b0657417
Merge pull request #1530 from mtrmac/progress-updates
Improve progress bars, and update mpb
2022-04-27 18:35:32 +02:00
Miloslav Trmač 3a9550c3e8 Update to github.com/vbauerster/mpb/v7 v7.4.1
... so that we test all of this with the new semantics.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-27 18:17:42 +02:00
Miloslav Trmač 2837c2a3e3 Don't call bar.SetRefill with negative numbers
If srcInfo.Size == -1, the progress bar is not showing the
refill value anyway (customPartialBlobDecorFunc is only
used if size is known), so don't bother calling this function
with nonsense data, if anything, at least to emphasize that this
condition is, in principle, possible.

Should not affect behavior, hopefully.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-27 18:17:31 +02:00
Miloslav Trmač f090300aca Add progressBar.mark100PercentComplete, and use it on all progress bars
This correctly handles both the "size known" and the "size unknown" cases,
and because we now record the originally-configured progress bar size
in the progressBar struct, the caller doesn't need to track it.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-27 18:17:30 +02:00
Miloslav Trmač c444bc3149 Wrap a *mpb.Bar in a *progressBar
This will allow us to add more state and methods to the bar
object, without copy&pasting.

For now, this just wraps one pointer in another, and should
not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-27 18:16:14 +02:00
Miloslav Trmač 83bc18acfd Track the original source blob's size in the progress bar
In particular, if the source is compressed, track the full size
of the original compressed blob in the progress bar, even if the decompressed
version has a different size (e.g. because the encryption adds a header or a MAC).

This original size is easy to determine and eaiser to explain to users; so let's do
the simple thing.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-27 18:16:14 +02:00
Miloslav Trmač 69dde2ee4a Add more operations within the scope of progress bars
Already draw the progress bar before opening the source's layer
or config blob, so that the users can have a visual indication
of something related to that blob happening if it takes too long.

(For the .ConfigBlob() call, this might not make a difference,
because in _some_ cases we trigger reading the config via
.OCIConfig in checkImageDestinationForCurrentRuntime(), and the
config blob is cached, but it might make a difference in the other
cases, and it doesn't hurt in this one.)

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-27 18:16:14 +02:00
Miloslav Trmač 5a56b1e41a Remove a redundant bar.SetTotal
The same srcInfo.size was passed to createProgressBar, so this
does nothing at best if size is known; if it is unknown,
it seems to effectively also be a no-op with a recent version of mpb
(it sets the total value to 0, the current progress at the time,
but it doesn't enable auto-complete, so it doesn't make a difference).

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-27 18:16:14 +02:00
Miloslav Trmač c8c17e298f Rename progress_reader* to progress_channel*
... to cleanly differentiate the code related to chan<- types.ProgressProperties
from the code related to progress bars.

Only moves unchanged code, should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-27 18:16:14 +02:00
Miloslav Trmač 9c46add002 Move blobChunkAccessorProxy to copy/progress_bars.go
Second part: Move blobChunkAccessorProxy to the newly established
progress_bars.go.

Only moves unchanged code, should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-27 18:16:14 +02:00
Miloslav Trmač 66100ac0e2 Move progress-bar-specific utilities from copy.go to new progress_bars.go
Let's try to make copy.go shorter, and consolidate progress bar code to
new copy/progress_bars.go.

First, move the code from copy.go.

Only moves unchanged code, should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-27 18:16:09 +02:00
Miloslav Trmač 4ba557564d Improve the documentation of the objects in copy/progress_reader.go a tiny bit
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-26 23:06:44 +02:00
Daniel J Walsh 0262048058
Merge pull request #1528 from containers/dependabot/go_modules/github.com/sylabs/sif/v2-2.7.0
build(deps): bump github.com/sylabs/sif/v2 from 2.6.0 to 2.7.0
2022-04-26 13:25:00 -04:00
dependabot[bot] c3540191af
build(deps): bump github.com/sylabs/sif/v2 from 2.6.0 to 2.7.0
Bumps [github.com/sylabs/sif/v2](https://github.com/sylabs/sif) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/sylabs/sif/releases)
- [Changelog](https://github.com/sylabs/sif/blob/master/.goreleaser.yml)
- [Commits](https://github.com/sylabs/sif/compare/v2.6.0...v2.7.0)

---
updated-dependencies:
- dependency-name: github.com/sylabs/sif/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-26 08:13:09 +00:00
Valentin Rothberg be085685e5
Merge pull request #1497 from mtrmac/delete-compute-digest
Don't require a Docker-Content-Digest header when deleting images
2022-04-25 10:06:28 +02:00
Valentin Rothberg 729244e148
Merge pull request #1527 from mtrmac/indent
Use correct list syntax in containers-registries.conf(5)
2022-04-25 10:05:47 +02:00
Valentin Rothberg 9fe075b754
Merge pull request #1517 from mtrmac/strings.NewReader
Use strings.NewReader instead of bytes.NewBufferString
2022-04-25 09:15:41 +02:00
Miloslav Trmač 15e689d480 Don't require a Docker-Content-Digest header when deleting images
Per https://github.com/containers/image/issues/1010 , it seems
the header is not populated by AWS ECR.

We were actually computing the digest from the manifest bytes
already, so this is both more robust and simpler.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-22 17:46:34 +02:00
Miloslav Trmač 620ff7cd4f Use strings.NewReader instead of bytes.NewBufferString
Just a micro-optimization: avoid maintaining state for
a read/write buffer, and the allocation inherent in a
string -> []byte conversion.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-22 17:45:34 +02:00
Miloslav Trmač d8b67984d8 Use correct list syntax in containers-registries.conf(5)
Four leading spaces are interpreted by go-md2man as a code block.

Add a new line to start a new paragraph, so that go-md2man recognizes
the list syntax.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-04-22 17:45:09 +02:00
Daniel J Walsh 71745412ed
Merge pull request #1525 from vrothberg/fix-1523
man containers-registries.conf: clarify mirror association
2022-04-22 11:41:49 -04:00
Valentin Rothberg 297ee4e43b man containers-registries.conf: clarify mirror association
Clarify that a `[[registry.mirror]]` is associated only with the
previous `[[registry]]`.

Fixes: #1523
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-04-22 09:04:01 +02:00
Miloslav Trmač 8527e23886
Merge pull request #1524 from containers/dependabot/go_modules/github.com/sylabs/sif/v2-2.6.0
build(deps): bump github.com/sylabs/sif/v2 from 2.5.0 to 2.6.0
2022-04-21 14:49:50 +02:00
dependabot[bot] 49c7207e31
build(deps): bump github.com/sylabs/sif/v2 from 2.5.0 to 2.6.0
Bumps [github.com/sylabs/sif/v2](https://github.com/sylabs/sif) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/sylabs/sif/releases)
- [Changelog](https://github.com/sylabs/sif/blob/master/.goreleaser.yml)
- [Commits](https://github.com/sylabs/sif/compare/v2.5.0...v2.6.0)

---
updated-dependencies:
- dependency-name: github.com/sylabs/sif/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-21 08:13:08 +00:00
Valentin Rothberg d2d961d5d3
Merge pull request #1521 from mtrmac/go1.16
Update to benefit from Go 1.16
2022-04-14 09:14:50 +02:00