Commit Graph

1091 Commits

Author SHA1 Message Date
Ed Santiago
f992ab28e7 PARTIAL CHERRY-PICK: System tests: various fixes
- start_registry() - use bash builtins, not curl, to test
   if registry port is open.

   curl on Fedora now barfs with "Received HTTP/0.9 when not
   allowed" when the registry is run with SSL, because the
   response is not valid HTTP. One workaround would be 'curl
   --http0.9' but (surprise) that option doesn't exist on rhel8;
   and even with that option we would need --output /dev/null
   to silence a different curl warning. Curl is overkill
   for this purpose anyway, all we really need is netcat
   or some simple binary is-port-listening-or-not test.
   Fortunately, bash provides a /dev/tcp/<host>/<port>
   emulator that does the right thing and works on Fedora
   as well as RHEL8.

 - new log_and_run() helper

   This is the noisiest yet least critical part of this PR.
   I'm sorry. It's motivated by my frustration in trying
   to reproduce the curl problem above: getting just the
   right incantation of openssl + podman-run cost me time.
   With this enhancement, important commands are logged
   as part of the output of failing tests, making it
   easy[*] for maintenance programmers to figure out a
   recipe for reproducing the failure.

     [*] "easy" as long as the test-writing developer
         uses log_and_run() wisely.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-02-21 16:57:51 +01:00
Giuseppe Scrivano
14f5abb6a6 Dockerfile: use golang-github-cpuguy83-go-md2man
the package was renamed on Fedora 31.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-02-21 16:29:49 +01:00
Miloslav Trmač
0484557df8 Update to github.com/mtrmac/gpgme v0.1.2
This fixes CVE-2020-8945 by incorporating proglottis/gpgme#23 .

Other changes included by the rebase:
- Support for gpgme_off_t (~no-op on Linux)
- Wrapping a few more GPGME functions (irrelevant if we don't call them)

Given how invasive the CVE fix is (affecting basically all binding
code), it seems safer to just update the package (and be verifiably
equivalent with upstream) than to backport and try to back out the few
other changes.

Performed by updating vendor conf and
$ vndr github.com/mtrmac/gpgme

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-02-21 16:29:49 +01:00
Miloslav Trmač
c16c7e37f2 Use a specific go-check commit in vendor.conf
v1 is a branch, not a tag, so (make vendor) was updating it,
bringing unexpected (not necessarily unwanted, but unexpected)
changes.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-02-21 16:29:49 +01:00
Miloslav Trmač
7902be2dc4 Re-add c/image documentation
... which was for some uknown reason removed in the previous backport.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2020-02-21 16:29:43 +01:00
Valentin Rothberg
5c3a5ddf2d [0.1.37] update github.com/containers/image
Note that this includes fixes for
https://access.redhat.com/security/cve/CVE-2020-1702.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-06 13:09:01 +01:00
Miloslav Trmač
e079f9d61b Bump to version v0.1.37
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-06-14 17:56:35 +02:00
Valentin Rothberg
ceabc0a404
Merge pull request #679 from mtrmac/rebases
Update buildah to 1.8.4, c/storage to 1.12.10
2019-06-14 17:51:42 +02:00
Miloslav Trmač
523b8b44a2 Update buildah to 1.8.4, c/storage to 1.12.10
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-06-14 17:24:35 +02:00
Miloslav Trmač
d2d1796eb5
Merge pull request #666 from mtrmac/registries.conf-mirrors
Rebase containers/image to v2.0.0
2019-06-14 01:07:43 +02:00
Miloslav Trmač
c67e5f7425 Rebase containers/image to v2.0.0
This adds the mirror-by-digest-only option to mirrors, and moves the search
order to an independent list.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-06-14 00:19:39 +02:00
Miloslav Trmač
1b8686d044
Merge pull request #673 from mtrmac/systemtest-openpgp
Skip systemtest/050-signing.bats if skopeo can't create signatures
2019-06-13 19:07:12 +02:00
Miloslav Trmač
a4de1428f9 Skip systemtest/050-signing.bats if skopeo can't create signatures
This does not happen in this repo's tests, but containers/image's
(make test-skopeo) fails in the containers_image_openpgp configuration with

> not ok 10 signing
> ...
> # time="2019-06-11T20:59:32Z" level=fatal msg="Signing not supported: signing is not supported in github.com/containers/image built with the containers_image_openpgp build tag"

To reproduce/test this:
> make test-system BUILDTAGS='ostree containers_image_openpgp'

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-06-13 18:53:53 +02:00
Miloslav Trmač
524f6c0682
Merge pull request #677 from edsantiago/wait_for_registry
start_registry: wait for registry to be ready
2019-06-13 18:48:59 +02:00
Ed Santiago
fa18fce7e8 start_registry: wait for registry to be ready
The usual 'podman run -d' race condition: we've been forking
off the container but not actually making sure it's up; this
leads to flakes in which we try (and fail) to access it.

Solution: use curl to check the port; we will expect a zero
exit status once we can connect. Time out at ten seconds.

Resolves: #675

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-06-13 09:27:58 -06:00
Miloslav Trmač
96be1bb155
Merge pull request #668 from mtrmac/fedora-30-gpg2
Explicitly disable encrypting the test GPG key
2019-06-11 16:50:10 +02:00
Miloslav Trmač
23c6b42b26 Explicitly disable encrypting test GPG keys
Since GPG 2.1, GPG asks for a passphrase by default; opt out when
generating test keys to avoid
> gpg: agent_genkey failed: No pinentry
> gpg: key generation failed: No pinentry
which happens otherwise (and we can't use an interactive pinentry
in a batch process anyway).

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-06-10 22:03:23 +02:00
Miloslav Trmač
6307635b5f
Merge pull request #659 from edsantiago/systemtests
systemtest - new set of BATS tests for RHEL8 gating
2019-06-04 18:55:07 +02:00
Ed Santiago
47e7cda4e9 System tests - get working under podman-in-podman
Skopeo CI tests run under podman; hence the registries
run in the tests will be podman-in-podman. This requires
complex muckery to make work:

 - install bats, jq, and podman in the test image
 - add new test-system Make target. It runs podman
   with /var/lib/containers bind-mounted to a tmpdir
   and with other necessary options; and invokes a
   test script that hack-edits /etc/containers/storage.conf
   before running podman for the first time.
 - add --cgroup-manager=cgroupfs option to podman
   invocations in BATS: without this, podman-in-podman
   fails with:
       systemd cgroup flag passed, but systemd support for managing cgroups is not available

Also: gpg --pinentry-mode option is not available on all
our test platforms. Check for it before using.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-05-28 10:53:12 -06:00
Ed Santiago
5dd3b2bffd fixup! Incorporate review feedback from mtrmac
- Got TLS registry working, and test enabled. The trick was to
  copy the .crt file to a separate directory *without* the .key

- auth test - set up a private XDG_RUNTIME_DIR, in case tests
  are being run by a real user.

- signing test - remove FIXME comments; questions answered.

- helpers.bash - document start_registries(); save a .crt file,
  not .cert; and remove unused stop_registries() - it's too hard
  to do right, and very easy for individual tests to 'podman rm -f'

- run-tests - remove SKOPEO_BINARY definition, it's inconsistent
  with the one in helpers.bash

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-05-28 10:10:50 -06:00
Ed Santiago
12f0e24519 systemtest - new set of BATS tests for RHEL8 gating
Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-05-28 10:10:50 -06:00
Miloslav Trmač
b137741385
Merge pull request #664 from mtrmac/ubuntu-build
Fix build on Ubuntu
2019-05-27 17:19:33 +02:00
Miloslav Trmač
233804fedc Fix build on Ubuntu
btrfs/ioctl.h is in libbtrfs-dev (now?), btrfs-tools does not pull it in.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-05-27 17:01:44 +02:00
Daniel J Walsh
0c90e57eaf
Merge pull request #657 from TristanCacqueray/master
Add integration test for invalid reference
2019-05-20 08:14:14 -04:00
Tristan Cacqueray
8fb4ab3d92 Add integration test for invalid reference
This change adds a couple of tests to prevent further regression
introduced by https://github.com/containers/skopeo/pull/653

Signed-off-by: Tristan Cacqueray <tdecacqu@redhat.com>
2019-05-19 03:02:19 +00:00
Miloslav Trmač
8c9e250801
Merge pull request #656 from rhatdan/unshare
Skopeo crashes on any invalid transport
2019-05-18 21:07:10 +02:00
Daniel J Walsh
04aee56a36
Skopeo crashes on any invalid transport
We need to verfy that the user entered a valid transport before attempting
to see if the transport exists,  otherwise skopeo segfaults.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-05-18 12:30:15 -04:00
Daniel J Walsh
4f1fabc2a4
Merge pull request #654 from rhatdan/master
Update release to v0.1.36
2019-05-18 07:37:37 -04:00
Daniel J Walsh
43bc356337
Move to version v0.1.37-dev
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-05-18 06:39:12 -04:00
Daniel J Walsh
41991bab70
Bump to version v0.1.36
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-05-18 06:37:01 -04:00
Miloslav Trmač
2b5086167f
Merge pull request #653 from TristanCacqueray/master
rootless: don't create a namespace unless for containers-storage
2019-05-18 05:49:21 +02:00
Tristan Cacqueray
b46d16f48c rootless: don't create a namespace unless for containers-storage
This change fixes skopeo usage in restricted environment such as
bubblewrap where it doesn't need extra capabilities or user namespace
to perform its action.

Close #649
Signed-off-by: Tristan Cacqueray <tdecacqu@redhat.com>
2019-05-18 02:53:20 +00:00
Tristan Cacqueray
9fef0eb3f3 vendor: update containers/image
Depends-On: https://github.com/containers/image/pull/631
Signed-off-by: Tristan Cacqueray <tdecacqu@redhat.com>
2019-05-18 02:53:20 +00:00
Miloslav Trmač
30b0a1741e
Merge pull request #650 from csomh/fix-man-page-typo
Fix typo on the main man page
2019-05-15 18:51:37 +02:00
Hunor Csomortáni
945b9dc08f Fix typo on the main man page
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
2019-05-15 17:20:26 +02:00
Miloslav Trmač
904b064da4
Merge pull request #647 from nalind/config
inspect: add a --config flag
2019-05-09 15:37:12 +02:00
Nalin Dahyabhai
7ae62af073 inspect: add a --config flag
Add a --config option to "skopeo inspect" to dump an image's
configuration blob in the OCI format, or the original format
if --config and --raw are specified.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-05-08 11:07:52 -04:00
Miloslav Trmač
7525a79c93
Merge pull request #646 from QiWang19/creds
Add --no-creds flag to skopeo inspect
2019-05-07 20:53:02 +02:00
juanluisvaladas
07287b5783 Add --no-creds flag to skopeo inspect
Follow PR #433
Close #421

Currently skopeo inspect allows to:
Use the default credentials in $HOME/.docker.config
Explicitly define credentials via de --creds flag

This implements a --no-creds flag which will query docker registries anonymously.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-05-03 13:30:33 -04:00
Daniel J Walsh
0a2a62ac20
Merge pull request #618 from SUSE/registry-mirror
Add skopeo registry mirror integration tests
2019-04-25 06:26:08 -04:00
Daniel J Walsh
5581c62a3a
Merge pull request #632 from hakandilek/master
build image updated to ubuntu:18.10
2019-04-25 06:24:47 -04:00
Sascha Grunert
6b5bdb7563
Add skopeo registry mirror integration tests
- Update toml to latest release
- Update containers/image
- Add integration tests
- Add hidden `--registry-conf` flag used by the integration tests

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-25 11:35:12 +02:00
Valentin Rothberg
2bdffc89c2
Merge pull request #640 from rhatdan/vendor
Vendor update container/storage
2019-04-25 11:17:15 +02:00
Daniel J Walsh
65e6449c95
Vendor update container/storage
overlay: propagate errors from mountProgram
utils: root in a userns uses global conf file
Fix handling of additional stores
Correctly check permissions on rootless directory
Fix possible integer overflow on 32bit builds
Evaluate device path for lvm
lockfile test: make concurrent RW test determinisitc
lockfile test: make concurrent read tests deterministic

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-04-24 20:32:46 -04:00
Valentin Rothberg
2829f7da9e
Merge pull request #638 from giuseppe/skip-namespace-if-not-needed
rootless: do not create a user namespace if not needed
2019-04-24 14:27:48 +02:00
Giuseppe Scrivano
ece44c2842
rootless: do not create a user namespace if not needed
do not create a user namespace if we already have the capabilities we
need for pulling and storing an image.

Closes: https://github.com/containers/skopeo/issues/637

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-24 13:48:31 +02:00
Miloslav Trmač
0fa335c149
Merge pull request #635 from SUSE/buildah-update
Vendor the latest buildah master
2019-04-24 07:16:29 +02:00
Sascha Grunert
5c0ad57c2c
Vendor the latest buildah master
This commit contains the necessary split-up between buildah/pkg and
buildah/util to avoid dependency breaks.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-23 15:07:37 +02:00
Hakan Dilek
b2934e7cf6 build image updated to ubuntu:18.10
fixes #621

Signed-off-by: Hakan Dilek <hakandilek@gmail.com>
2019-04-17 22:04:12 +02:00
Daniel J Walsh
2af7114ea1
Merge pull request #629 from chuanchang/add_help_to_makefile
added help to Makefile
2019-04-17 12:04:02 -04:00