Commit graph

11135 commits

Author SHA1 Message Date
dependabot-preview[bot] 12fb9e4653
Bump github.com/sirupsen/logrus from 1.8.0 to 1.8.1
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.8.0...v1.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-12 06:15:31 -05:00
Daniel J Walsh 81737b3773
Merge pull request #9686 from edsantiago/apiv2_jsonify
apiv2 tests: finally fix POST as originally intended
2021-03-11 15:52:19 -05:00
OpenShift Merge Robot 8d33bfabaa
Merge pull request #9524 from riyad/apiv3-print-tags-when-building
[Compat API] Also print successfully tagging images in /build endpoint
2021-03-11 17:55:00 +01:00
OpenShift Merge Robot e2d35e55d0
Merge pull request #9652 from alvistack/master-linux-amd64
Update nix pin with `make nixpkgs`
2021-03-10 19:39:50 +01:00
OpenShift Merge Robot 2343161593
Merge pull request #9668 from rhatdan/man
Document CONTAINERS_CONF/CONTAINERS_STORAGE_CONF Env variables
2021-03-10 19:38:49 +01:00
OpenShift Merge Robot 786757fb01
Merge pull request #9681 from rhatdan/rm
Removing a non existing container API should return 404
2021-03-10 14:04:51 +01:00
Ed Santiago 258749e43d apiv2 tests: finally fix POST as originally intended
When I originally wrote this code I had no idea what POST
would look like so I did a sloppy job, deferring making it
usable. Now that we have some real-world examples in place,
I have a better understanding of what params look like and
how to make tests more readable/maintainable. (Deferring isn't
always bad: one of my early ideas was to separate params using
commas; that would've been a disaster because some JSON values,
such as arrays, include commas).

This commit implements a better way of dealing with POST:

  * The main concept is still 'key=value'
    * When value is a JSON object (dictionary, array), it
      can be quoted.
    * Multiple params are simply separated by spaces.
      The 3-digit HTTP code is a prominent, readable separator
      between POST params and expected results. The parsing
      code is a little uglier, but test developers need
      never see that. The important thing is that writing
      tests is now easier.
  * POST params can be empty (this removes the need for a
    useless '')

I snuck in one unrelated change: one of the newly-added
tests, .NetworkSettings, was failing when run rootless
(which is how I test on my setup). I made it conditional.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-03-10 05:24:44 -07:00
Daniel J Walsh c9ef260710
Document CONTAINERS_CONF/CONTAINERS_STORAGE_CONF Env variables
Also Switch to using CONTAINERS_REGISTRIES_CONF for registries.conf
overrides.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-10 06:34:47 -05:00
OpenShift Merge Robot 5331096b38
Merge pull request #9612 from containers/dependabot/go_modules/github.com/coreos/go-systemd/v22-22.2.0
Bump github.com/coreos/go-systemd/v22 from 22.1.0 to 22.2.0
2021-03-10 10:31:48 +01:00
OpenShift Merge Robot 1ac2fb7817
Merge pull request #9676 from giuseppe/cli-overrides-conf
options: append CLI graph driver options
2021-03-10 10:30:49 +01:00
OpenShift Merge Robot 4d9227d22c
Merge pull request #9678 from xcffl/doc-sock-in-container-privileged
[CI:DOCS] Add docs about how to access APIs inside containers
2021-03-10 10:11:48 +01:00
OpenShift Merge Robot d98b55f03b
Merge pull request #9669 from edsantiago/apiv2_registry
apiv2 tests: add helpers to start/stop a local registry
2021-03-10 10:10:48 +01:00
Daniel J Walsh f1eb8e8162
Removing a non existing container API should return 404
Currently we were overwrapping error returned from removal
of a non existing container.

$ podman rm bogus -f
Error: failed to evict container: "": failed to find container "bogus" in state: no container with name or ID bogus found: no such container

Removal of wraps gets us to.

./bin/podman rm bogus -f
Error: no container with name or ID "bogus" found: no such container

Finally also added quotes around container name to help make it standout
when you get an error, currently it gets lost in the error.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-10 04:08:29 -05:00
xcffl dc0c72a48b
Docs: Add docs to access APIs inside container
Signed-off-by: xcffl <2216902+xcffl@users.noreply.github.com>
2021-03-10 07:47:52 +08:00
OpenShift Merge Robot 09473d4300
Merge pull request #9677 from vrothberg/fix-9672
podman load: fix error handling
2021-03-09 15:11:49 +01:00
OpenShift Merge Robot 66ac9426ec
Merge pull request #9630 from vrothberg/cp-rootless-eperms
podman cp: ignore EPERMs in rootless mode
2021-03-09 14:33:48 +01:00
Giuseppe Scrivano 6d4899745c
options: append CLI graph driver options
if --storage-opt are specified on the CLI append them after what is
specified in the configuration files instead of overriding it.

Closes: https://github.com/containers/podman/issues/9657

[NO TESTS NEEDED]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-09 12:54:23 +01:00
Valentin Rothberg 930bec4d3a podman load: fix error handling
Make sure to properly return loading errors and to set the exit code
accordingly.

Fixes: #9672
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-09 11:53:50 +01:00
OpenShift Merge Robot 36ec835298
Merge pull request #9671 from vrothberg/fix-9670
rm pkg/api/handlers/libpod/copy.go
2021-03-09 11:33:26 +01:00
Valentin Rothberg 1f2f7e7459 podman cp: evaluate symlink correctly when copying from container
When copying from a container, make sure to evaluate the symlinks
correctly.  Add tests copying a symlinked directory from a running and
a non-running container to execute both path-resolution paths.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-09 10:45:15 +01:00
Valentin Rothberg 2033fa4c79 rm pkg/api/handlers/libpod/copy.go
Remove the file since it only contains dead code.  The archive endpoints
are shared between the libpod and the compat API and both use the compat
package.

[NO TESTS NEEDED] since we're removing dead code.

Fixes: #9670
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-09 09:27:03 +01:00
Valentin Rothberg 31b11b5cd6 podman cp: fix copying to a non-existent dir
Copy is full of perils.  Some of them are the nuances when copying
directories.  Who would have thought that
 * cp dir   foo
 * cp dir/  foo
 * cp dir/. foo
are all supposed to yield the same result when foo does not exist.

`podman cp` now supports all three notations, which required to massage
the front-end code in `cmd/podman` a bit.  The tests have been extended
and partially rewritten to test container->host and host->container
copy operations.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-09 09:02:14 +01:00
Valentin Rothberg a61d70cf8e podman cp: fix ownership
Make sure the files are chowned to the host/container user, depending on
where things are being copied to.

Fixes: #9626
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-09 09:02:14 +01:00
Valentin Rothberg 2abfef3809 podman cp: ignore EPERMs in rootless mode
Ignore permission errors when copying from a rootless container.
TTY devices inside rootless containers are owned by the host's
root user which is "nobody" inside the container's user namespace
rendering us unable to even read them.

Enable the integration test which was temporarily disabled for rootless
users.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-09 09:02:14 +01:00
Valentin Rothberg d175fbfdb4 vendor buildah@v1.19.8
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-09 09:02:14 +01:00
Ed Santiago e33f523907 apiv2 tests: add helpers to start/stop a local registry
...and a rudimentary set of /auth tests for PR#9589 (disabled).

This simply adds a new start_registry() helper function that
allocates a random unused port, pulls a registry image, creates
a local certificate + random username + random password, and
fires everything up. Since none of this is (yet) used in CI,
this is very low risk.

The only infinitessimally-risky change is using a dedicated
subdirectory of $WORKDIR (instead of $WORKDIR itself) as
the podman root. This fixes a dumb oversight on my part:
the workdir has grown to be used for much more than just
podman root; this change removes clutter and makes it
easier for humans to debug in cases of problems.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-03-08 18:08:17 -07:00
OpenShift Merge Robot 789d579bc4
Merge pull request #9651 from rhatdan/volume
[NO TESTS NEEDED] podman-remote build does not support volumes
2021-03-08 23:35:47 +01:00
OpenShift Merge Robot 021ff992ff
Merge pull request #8172 from rhatdan/storage
[NO TESTS NEEDED] allow the removal of storage images
2021-03-08 23:32:34 +01:00
OpenShift Merge Robot ff46d13ea6
Merge pull request #9667 from mheon/bump-3.1.0-rc1
[CI:DOCS] Bump to v3.1.0-RC1
2021-03-08 22:33:36 +01:00
Matthew Heon e926b5d73e Bump to v3.1.0-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-03-08 15:45:43 -05:00
Matthew Heon aa9616cd4d Bump to v3.1.0-rc1
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-03-08 15:45:40 -05:00
OpenShift Merge Robot ba36d790db
Merge pull request #9665 from psgreco/master-checkexistentvolumes
[NO TESTS NEEDED] Compat API: Avoid trying to create volumes if they already exist
2021-03-08 21:35:52 +01:00
Daniel J Walsh e9db604922
allow the removal of storage images
Sometimes if the system crashes while an image is being pulled
containers/storage can get into a bad state.  This PR allows the
user to call into container storage to remove the image.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-08 13:55:45 -05:00
Daniel J Walsh 9eac4a7f7b
podman-remote build does not support volumes
Remove --volume option from podman-remote since it is
not supported, also add information to podman-build man page
indicating options not supported over remote connections.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-08 13:46:42 -05:00
Pablo Greco d1878cc675 Compat API: Avoid trying to create volumes if they already exist
Fixes commit: 53d22c779c

Signed-off-by: Pablo Greco <pgreco@centosproject.org>
2021-03-08 15:18:42 -03:00
OpenShift Merge Robot b386d23bf0
Merge pull request #9627 from xatier/master
[NO TESTS NEEDED] Bump pre-commit-hooks version
2021-03-08 19:06:18 +01:00
OpenShift Merge Robot 1e1035cf74
Merge pull request #9659 from containers/dependabot/go_modules/github.com/onsi/gomega-1.11.0
Bump github.com/onsi/gomega from 1.10.5 to 1.11.0
2021-03-08 11:53:18 -05:00
OpenShift Merge Robot b6079bcf4a
Merge pull request #9592 from rhatdan/timestamp
Numerous buildah fixes found by Ed's testing of buildah tests against podman.
2021-03-08 10:07:54 -05:00
OpenShift Merge Robot bbb9d9b078
Merge pull request #9649 from rhatdan/kube
Allow users to generate a kubernetes yaml off non running containers
2021-03-08 10:06:56 -05:00
Daniel J Walsh 7e289833ed
Bump github.com/onsi/gomega from 1.10.5 to 1.11.0
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.10.5 to 1.11.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.10.5...v1.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-08 08:54:47 -05:00
OpenShift Merge Robot 6fe634c916
Merge pull request #9658 from containers/dependabot/go_modules/github.com/onsi/ginkgo-1.15.1
Bump github.com/onsi/ginkgo from 1.15.0 to 1.15.1
2021-03-08 08:33:53 -05:00
OpenShift Merge Robot 7c09752fb8
Merge pull request #9525 from vrothberg/prune
[NO TESTS NEEDED] Prune and debloat
2021-03-08 06:21:54 -05:00
Daniel J Walsh 0e36e65eaa
Allow users to generate a kubernetes yaml off non running containers
Currently if you attempt to create a kube.yaml file off of a non running
container where the container runs as a specific User, the creation
fails because the storage container is not mounted. Podman is supposed to
read the /etc/passwd entry inside of the container but since the
container is not mounted, the c.State.Mountpoint == "".  Podman
incorrectly attempts to read /etc/passwd on the host, and fails if the
specified user is not in the hosts /etc/passwd.

This PR mounts the storage container, if it was not mounted so the read
succeeds.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-08 06:14:08 -05:00
dependabot-preview[bot] 80390dd180
Bump github.com/onsi/ginkgo from 1.15.0 to 1.15.1
Bumps [github.com/onsi/ginkgo](https://github.com/onsi/ginkgo) from 1.15.0 to 1.15.1.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v1.15.0...v1.15.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-08 06:10:15 -05:00
Valentin Rothberg d0d084dd8c turn hidden --trace into a NOP
The --trace has helped in early stages analyze Podman code.  However,
it's contributing to dependency and binary bloat.  The standard go
tooling can also help in profiling, so let's turn `--trace` into a NOP.

[NO TESTS NEEDED]

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-08 09:22:42 +01:00
Valentin Rothberg 320df83881 pkg/terminal: use c/storage/pkg/homedir
This also prunes the dependency on `k8s.io/client-go`.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-08 09:21:13 +01:00
OpenShift Merge Robot b7c00f2cc0
Merge pull request #9647 from mlegenovic/master
Compat API: Fix the response of 'push image' endpoint
2021-03-07 14:25:52 -05:00
OpenShift Merge Robot 4174b06a4b
Merge pull request #9648 from jmguzik/unify-mount-consts
[NO TESTS NEEDED] Cleanup/unify mount consts
2021-03-07 14:13:51 -05:00
Wong Hoi Sing Edison cc7a7568aa
Update nix pin with make nixpkgs
Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2021-03-07 21:36:33 +08:00
Daniel J Walsh 9e75cafd5c
build-arg
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-07 08:08:32 -05:00