Commit Graph

1273 Commits

Author SHA1 Message Date
Nalin Dahyabhai
7d251f5a74 copy: add a --all/-a flag
Add a --all/-a flag to instruct us to attempt to copy all of the
instances in the source image, if the source image specified to "skopeo
copy" is actually a list of images.  Previously, we'd just try to locate
one for our preferred OS/arch combination.

Add a couple of tests to verify that we can copy an image into and then
back out of containers-storage.  The contents of an image that has been
copied out of containers-storage need a bit of tweaking to compensate
for containers-storage's habit of returning uncompressed versions of the
layer blobs that were originally written to it, in order to be
comparable to the image as it was when it was pulled from a registry.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-10-22 11:05:42 -04:00
Valentin Rothberg
5f9a6ea621
Merge pull request #744 from edsantiago/bats
System tests: various fixes
2019-10-16 10:07:17 +02:00
Ed Santiago
58248412bd System tests: various fixes
- zstd test - give unique name.

   a36d81c copy/pasted an existing test but didn't give
   the new test a new name, leading to bats warning:
      duplicate test name(s) in [...]/020-copy.bats

 - 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>
2019-10-15 15:59:14 -06:00
Mrunal Patel
5b0a7890ea
Merge pull request #742 from nalind/podman-workaround
Temporarily work around auth.json location confusion
2019-10-15 14:50:09 -07:00
Nalin Dahyabhai
4962559e5c Temporarily work around auth.json location confusion
Temporarily work around https://github.com/containers/libpod/issues/4227
until Fedora has an updated packaged version of podman that includes
that fix, at which point we should revert this patch.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-10-15 12:36:19 -04:00
Miloslav Trmač
f72e39fc10
Merge pull request #736 from mtrmac/integration
Update to c/image v4.0.1
2019-10-04 00:14:54 +02:00
Valentin Rothberg
7922028d7c Update to c/image v4.0.1
Update to use the correct c/image/v4 import path, work originally from
https://github.com/containers/skopeo/pull/733 by Valentin Rothberg <rothberg@redhat.com>.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-10-03 23:50:42 +02:00
Miloslav Trmač
881edbf122
Merge pull request #735 from vrothberg/734
systemtest: copy: docker->storage->oci-archive
2019-10-03 22:55:39 +02:00
Valentin Rothberg
51b54191a8 systemtest: copy: docker->storage->oci-archive
Add a systemtest copying an image from docker to storage and then to an
oci-archive.  There are other ways to trigger the same code paths, but
this one has caught a regression in c/image in libpod's.

Fixes: #734
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-10-02 20:02:24 +02:00
Valentin Rothberg
fa6e58074d
Merge pull request #731 from vrothberg/inspect-test-fix
systemtest/010-inspect.bats: require only PATH
2019-09-30 16:43:30 +02:00
Valentin Rothberg
1c243a5b12 systemtest/010-inspect.bats: require only PATH
The "inspect: env" test started failing since the environment in the
`fedora:latest` image has changed.  Hence, only check for `PATH` in
the image's environment which is a defacto standard.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-30 15:31:14 +02:00
Daniel J Walsh
7eb5f39255
Merge pull request #717 from chuanchang/inspect_env_test
systemtest: add simple env test in inspect.bats
2019-09-18 09:33:15 -04:00
Alex Jia
8d1bb15075 systemtest: add simple env test in inspect.bats
Signed-off-by: Alex Jia <chuanchang.jia@gmail.com>
2019-09-18 10:35:27 +08:00
Miloslav Trmač
5ae6b16c0f
Merge pull request #713 from vrothberg/shellcheck
Shellcheck fixes
2019-09-07 18:14:28 +02:00
Valentin Rothberg
8c96dca362 bash completion: add comments to keep scattered options in sync
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-06 16:23:34 +02:00
Valentin Rothberg
1d8f5f29a5 bash completion: use read -r instead of disabling SC2207
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Valentin Rothberg
b31f0da5c6 bash completion: support --opt arg completion
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Valentin Rothberg
a02e57dde8 bash-completion: use replacement instead of sed
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Valentin Rothberg
a000c1943d bash completion: disable shellcheck SC2207
Disabling SC2207 to continue setting COMPREPLY.

https://github.com/koalaman/shellcheck/wiki/SC2207

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Valentin Rothberg
86e3564356 bash completion: double-quote to avoid re-splitting
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Valentin Rothberg
c61a5ea2c4 bash completions: use bash replacement instead of sed
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Valentin Rothberg
89bb6158eb bash completion: remove unused variable
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Valentin Rothberg
646e197eed bash-completions: split decl and assignment to avoid masking retvals
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Valentin Rothberg
699c25568c bash completion: double-quote fixes
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Valentin Rothberg
0c579aca9c bash completion: hard-set PROG=skopeo
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Valentin Rothberg
bc8281c016 bash completion: remove unused variable
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Valentin Rothberg
91510e39ab bash completion: use || instead of -o
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Valentin Rothberg
7b0db25a74 bash completion: rm eval on assigned variable
warning: previous_extglob_setting is referenced but not assigned. [SC2154]

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-03 13:00:25 +02:00
Daniel J Walsh
18f0e1e20c
Merge pull request #671 from giuseppe/zstd
copy: add --dest-compress-format and --dest-compress-level
2019-09-03 06:54:49 -04:00
Giuseppe Scrivano
a36d81c55c
copy: add --dest-compress-format and --dest-compress-level
add the possibility to specify the format and the level to use when
compressing blobs.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-02 17:28:22 +02:00
Giuseppe Scrivano
976dd83a62
flag: add optionalIntValue
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-02 15:57:22 +02:00
Valentin Rothberg
9019e27ec5
Merge pull request #712 from vrothberg/go-proxy
Makefile: use go proxy
2019-08-30 17:04:55 +02:00
Valentin Rothberg
a1c5a1f4d2 Makefile: use go proxy
Use GOPROXY=https://proxy.golang.org to speed up fetching dependencies.
Setting it makes `make vendor` six times faster in my local env.

For details please refer to https://proxy.golang.org/.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-30 11:54:33 +02:00
Miloslav Trmač
c4b0c7ce05
Merge pull request #708 from nalind/inspect-raw
inspect --raw: skip the NewImage() step
2019-08-28 20:00:01 +02:00
Nalin Dahyabhai
43b014c82a inspect --raw: skip the NewImage() step
Skip the NewImage() step if we're just inspecting the raw manifest, so
that if the tag or digest being inspected resolves to a manifest list,
the local arch/OS combination doesn't need to be found in it to avoid an
error.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-08-28 13:19:27 -04:00
Miloslav Trmač
1e2d6f619b
Merge pull request #707 from vrothberg/update-oci-spec
update OCI image-spec to 775207bd45b6cb8153ce218cc59351799217451f
2019-08-26 15:34:49 +02:00
Valentin Rothberg
f1d8451b09 update OCI image-spec to 775207bd45b6cb8153ce218cc59351799217451f
This mainly pulls in the latest support for zstd-compressed layers and
eases testing of containers/image.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-26 12:43:24 +02:00
Miloslav Trmač
481bb94c5f
Merge pull request #685 from jvanz/inspect_env
inspect.go: inspect env variables
2019-08-16 01:10:54 +02:00
José Guilherme Vanz
a778e595b3
inspect.go: inspect env variables
Update the inspect command to show the environment variables

Signed-off-by: José Guilherme Vanz <jvanz@jvanz.com>
2019-08-14 16:40:10 -03:00
Miloslav Trmač
ee9e9dfc89
Merge pull request #703 from marcov/fix-ostree-buildtags
ostree: use both image and & storage buildtags
2019-08-08 18:17:02 +02:00
Marco Vedovati
0f1ded2ac8 ostree: use both image and & storage buildtags
The PR #700 replaced ostree buildtag with containers_image_ostree.
However specifying the ostree buildtag is needed by containers/storage
vfs driver.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-08-08 14:08:31 +02:00
Valentin Rothberg
44bc4a9eb7
Merge pull request #701 from vrothberg/release
Release v0.1.39
2019-08-06 15:55:50 +02:00
Valentin Rothberg
89d6d0c70f bump to v0.1.40-dev
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-06 14:15:16 +02:00
Valentin Rothberg
1cf1e06582 v0.1.39
* update github.com/containers/{image,storage}
 * ostree: use the correct build tags

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-06 14:14:31 +02:00
Valentin Rothberg
700b3102af update github.com/containers/{image,storage}
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-06 14:13:03 +02:00
Daniel J Walsh
c040b28fb8
Merge pull request #700 from marcov/ostree-buildtag
ostree: use the correct build tags
2019-08-06 07:46:47 -04:00
Marco Vedovati
af54437b44 ostree: use the correct build tags
Starting from 9b902d0, the ostree transport is disabled by default,
and ostree is enabled with the tag containers_image_ostree.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-08-06 13:05:24 +02:00
Valentin Rothberg
202c1ea2ac
Merge pull request #699 from vrothberg/release
Release v0.1.38
2019-08-02 16:14:29 +02:00
Valentin Rothberg
5348d246ba bump to v0.1.39-dev
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-02 13:56:02 +02:00
Valentin Rothberg
37f616ee4e release v0.1.38
* vendor github.com/containers/image@v3.0.0
* enforce blocking of registries
* Fix lowest possible go version to be 1.9
* man pages: add --dest-oci-accept-uncompressed-layers
* bash completion: add --dest-oci-accept-uncompressed-layers
* README.md: skopeo on openSUSE
* copy: add a CLI flag for OCIAcceptUncompressedLayers
* migrate to go modules
* README: Clarify use of `libbtrfs-dev` on Ubuntu

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-02 13:56:02 +02:00