11348 Commits

Author SHA1 Message Date
8de5607039 Fix remote client timezone test
The New York timezone changes between summer and winter time.
Make sure the test allows both timezones.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-03-15 15:56:57 +01:00
57e8c66322 Do not leak libpod package into the remote client
Some packages used by the remote client imported the libpod package.
This is not wanted because it adds unnecessary bloat to the client and
also causes problems with platform specific code(linux only), see #9710.

The solution is to move the used functions/variables into extra packages
which do not import libpod.

This change shrinks the remote client size more than 6MB compared to the
current master.

[NO TESTS NEEDED]
I have no idea how to test this properly but with #9710 the cross
compile should fail.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-03-15 14:02:04 +01:00
762148deb6 Split libpod/network package
The `libpod/network` package should only be used on the backend and not the
client. The client used this package only for two functions so move them
into a new `pkg/network` package.

This is needed so we can put linux only code into `libpod/network`, see #9710.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-03-15 14:01:52 +01:00
955aaccc55 fix use with localhost (testing)
Signed-off-by: troyready <troy@troyready.com>
2021-03-12 10:48:03 -08:00
9251b6c8cf add /auth for docker compatibility
This endpoint just validates credentials:
https://github.com/moby/moby/blob/v20.10.4/api/swagger.yaml#L7936-L7977

Fixes: #9564
Signed-off-by: troyready <troy@troyready.com>
2021-03-12 10:39:15 -08:00
fc02d16e72 Merge pull request #9684 from containers/dependabot/go_modules/github.com/sirupsen/logrus-1.8.1
Bump github.com/sirupsen/logrus from 1.8.0 to 1.8.1
2021-03-12 12:15:27 -05:00
605df430d9 Merge pull request #9703 from jmguzik/endpoint-networks
[NO TESTS NEEDED] create endpoint for querying libpod networks
2021-03-12 12:14:27 -05:00
0d6673e16c Merge pull request #9699 from jwhonce/wip/tests
Delete all containers and pods between tests
2021-03-12 11:36:30 -05:00
5b22ddd08e Merge pull request #9697 from edsantiago/fedora_gating_test_hang
sdnotify tests: try real hard to kill socat processes
2021-03-12 13:34:27 +00:00
3803d0a4a9 create endpoint for querying libpod networks
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-12 13:06:08 +01:00
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
660a72993c sdnotify tests: try real hard to kill socat processes
podman gating tests are hanging in the new Fedora CI setup;
long and tedious investigation suggests that 'socat' processes
are being left unkilled, which then causes BATS to hang when
it (presumably) runs a final 'wait' in its end cleanup.

The two principal changes are to exec socat in a subshell
with fd3 closed, and to pkill its child processes before
killing the process itself. I don't know if both are needed.
The pkill definitely is; the exec may just be superstition.
Since I've wasted more than a day of PTO time on this, I'm
okay with a little superstition. What I do know is that with
these two changes, my reproducer fails to reproduce in over
one hour of trying (normally it fails within 5 minutes).

AND, update: only rawhide (f35) leaves stray socat processes
behind. f33 and ubuntu do not, so 'pkill -P' fails.

I really have no idea what's going on.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-03-11 16:21:51 -07:00
7b0155cf78 Fix array instead of one elem network http api
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-12 00:03:03 +01:00
92a8d69a70 Delete all containers and pods between tests
New tearDown() deletes all pods and containers between tests

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-03-11 14:24:57 -07:00
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
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
e2d35e55d0 Merge pull request #9652 from alvistack/master-linux-amd64
Update nix pin with `make nixpkgs`
2021-03-10 19:39:50 +01:00
2343161593 Merge pull request #9668 from rhatdan/man
Document CONTAINERS_CONF/CONTAINERS_STORAGE_CONF Env variables
2021-03-10 19:38:49 +01:00
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
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
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
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
1ac2fb7817 Merge pull request #9676 from giuseppe/cli-overrides-conf
options: append CLI graph driver options
2021-03-10 10:30:49 +01:00
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
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
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
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
09473d4300 Merge pull request #9677 from vrothberg/fix-9672
podman load: fix error handling
2021-03-09 15:11:49 +01:00
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
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
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
36ec835298 Merge pull request #9671 from vrothberg/fix-9670
rm pkg/api/handlers/libpod/copy.go
2021-03-09 11:33:26 +01:00
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
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
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
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
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
d175fbfdb4 vendor buildah@v1.19.8
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-09 09:02:14 +01:00
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
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
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
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
e926b5d73e Bump to v3.1.0-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-03-08 15:45:43 -05:00
aa9616cd4d Bump to v3.1.0-rc1
Signed-off-by: Matthew Heon <mheon@redhat.com>
v3.1.0-rc1
2021-03-08 15:45:40 -05:00
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
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
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
d1878cc675 Compat API: Avoid trying to create volumes if they already exist
Fixes commit: 53d22c779c5d2df5ccda5a8e23db0501a0dadf44

Signed-off-by: Pablo Greco <pgreco@centosproject.org>
2021-03-08 15:18:42 -03:00
b386d23bf0 Merge pull request #9627 from xatier/master
[NO TESTS NEEDED] Bump pre-commit-hooks version
2021-03-08 19:06:18 +01:00
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