9191 Commits

Author SHA1 Message Date
49fa3e7399 Remove TEST_REMOTE_CLIENT from RCLI
We know these are TEST_, hoping this makes the display in
cirrus easier for users to see true|false, since this is the
valuable information is.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-10 12:47:43 -04:00
afa823e4e7 Fix handling of working dir
Buildah and podman build can create images without a working dir.

FROM fedora
WORKDIR /test

If you build this image with caching twice, the second time the image
will not have a working dir.

Similarly if you execute

podman run --workdir /foobar fedora

It blows up since the workingdir is not created automatically.

Finally there was duplicated code for getting the workingdir
out of an image, that this PR removes.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-10 12:46:05 -04:00
162625f2e7 Merge pull request #7138 from cevich/add_python_packages
Cirrus: Add python packages to images
2020-08-10 11:52:45 -04:00
c60b695e64 Default .Repository and .Tag values to <none>
Refactor the processing of Repository and Tag fields to default to <none>
when printing via --format flag. Previously, the default format would
print <none> but --format {{.Tag}} would not in some cases.

Fixes #7123

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-08-10 08:03:58 -07:00
6865058f2f generate systemd: fix error handling
Fix a bug in the error handling which returned nil instead of an error
and ultimately lead to nil dereferences in the client.  To prevent
future regressions, add a test and check for the error message.

Fixes: #7271
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-08-10 16:29:55 +02:00
39c493b3fc Do not use image CMD if user gave ENTRYPOINT
This matches Docker behavior, and seems to make sense - the CMD
may have been specific to the original entrypoint and probably
does not make sense if it was changed.

While we're in here, greatly simplify the logic for populating
the SpecGen's Command. We create the full command when making the
OCI spec, so the client should not be doing any more than setting
it to the Command the user passed in, and completely ignoring
ENTRYPOINT.

Fixes #7115

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-08-10 10:18:43 -04:00
569854d634 Unconditionally retrieve pod names via API
The ListContainers API previously had a Pod parameter, which
determined if pod name was returned (but, notably, not Pod ID,
which was returned unconditionally). This was fairly confusing,
so we decided to deprecate/remove the parameter and return it
unconditionally.

To do this without serious performance implications, we need to
avoid expensive JSON decodes of pod configuration in the DB. The
way our Bolt tables are structured, retrieving name given ID is
actually quite cheap, but we did not expose this via the Libpod
API. Add a new GetName API to do this.

Fixes #7214

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-08-10 10:15:51 -04:00
da00482ef2 Merge pull request #7238 from edsantiago/bats
system tests: podman-remote, image tree
2020-08-10 10:13:25 -04:00
3c880a9b83 system tests: podman-remote, image tree
- new sanity checks for podman-remote:
  - first, confirm that when PODMAN is "-remote",
    we actually talk to a server (validated by
    presence of "Server:" string in "podman version").
  - second, add test for #7212, in which we run
    "podman --remote" (podman with --remote flag,
    not podman-remote command) and make sure --remote
    is allowed both as the first option and also
    with other flag options preceding.

- new test for "podman image tree" (piggybacking on
  top of a "podman build" test, because that gives
  us lots of layers).

- skip "podman exec - basic test" when remote. It is consistently
  causing CI failures, breaking all of CI, due to #7241.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-08-10 06:27:44 -06:00
95e2e15a3f Merge pull request #7216 from 5eraph/master
support outbound-addr
2020-08-09 07:45:20 -04:00
3173a18f6f Merge pull request #7215 from vrothberg/flatten-the-curve
images: speed up lists
2020-08-08 07:14:37 -04:00
1298161ae4 Merge pull request #7075 from TomSweeneyRedHat/dev/tsweeney/runman
[CI:DOCS] BZ1860126 - Fix userns defaults in run man page
2020-08-08 06:24:07 -04:00
5aaf6788f9 [CI:DOCS] BZ1860126 - Fix userns defaults in run man page
Addresses the multiple "default" userns values found
in the podman-run(1) man page:  http://docs.podman.io/en/latest/markdown/podman-run.1.html.

This in response to: https://bugzilla.redhat.com/show_bug.cgi?id=1860126
which this PR wil fix.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-08-07 15:42:13 -04:00
e6a5a56aa6 changes to support outbound-addr
Fixes #6064

Signed-off-by: Bohumil Cervenka <5eraph@protonmail.com>
2020-08-07 19:34:45 +02:00
51159e7b83 Merge pull request #7232 from Luap99/podman-logs-tail
fix podman logs --tail when log is bigger than pagesize
2020-08-07 08:55:43 -04:00
8827100b98 image list: speed up
Listing images has shown increasing performance penalties with an
increasing number of images.  Unless `--all` is specified, Podman
will filter intermediate images.  Determining intermediate images
has been done by finding (and comparing!) parent images which is
expensive.  We had to query the storage many times which turned it
into a bottleneck.

Instead, create a layer tree and assign one or more images to nodes that
match the images' top layer.  Determining the children of an image is
now exponentially faster as we already know the child images from the
layer graph and the images using the same top layer, which may also be
considered child images based on their history.

On my system with 510 images, a rootful image list drops from 6 secs
down to 0.3 secs.

Also use the tree to compute parent nodes, and to filter intermediate
images for pruning.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-08-07 12:14:11 +02:00
2c79f9929d fix podman logs --tail when log is bigger than pagesize
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-08-06 20:56:30 +02:00
0d4a269c6d Merge pull request #7220 from baude/issue7124
podman-remote send name and tag
2020-08-05 23:35:41 +02:00
a948635041 Merge pull request #7212 from jwhonce/issues/7211
Refactor parsing to not require --remote to be first flag
2020-08-05 22:57:48 +02:00
cc26814f8d [CI:DOCS] Update podmanimages README.md
Updates to the README.md for the contrib/podmanimages directory.

This completes the changes to answer this Buildah issue: https://github.com/containers/buildah/issues/1693
and then also adds the quay.io/conatiners/podman images to the list of images.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-08-05 16:41:50 -04:00
bae6d5ddaf Merge pull request #7236 from mheon/write_error_to_inspect
Ensure that exec errors write exit codes to the DB
2020-08-05 21:57:48 +02:00
7a64ce35db Ensure that exec errors write exit codes to the DB
In local Podman, the frontend interprets the error and exit code
given by the Exec API to determine the appropriate exit code to
set for Podman itself; special cases like a missing executable
receive special exit codes.

Exec for the remote API, however, has to do this inside Libpod
itself, as Libpod will be directly queried (via the Inspect API
for exec sessions) to get the exit code. This was done correctly
when the exec session started properly, but we did not properly
handle cases where the OCI runtime fails before the exec session
can properly start. Making two error returns that would otherwise
not set exit code actually do so should resolve the issue.

Fixes #6893

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-08-05 14:30:48 -04:00
77f7bf9a9c podman-remote send name and tag
when loading an image with podman-remote load, we need to send a name and a tag to the endpoint

Fixes: #7124

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-08-05 12:34:44 -05:00
98da2fa806 Refactor parsing to not require --remote to be first
Use cobra.Command.FParseErrWhitelist to no longer require --remote to be
the first argument in flags when using CLI

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-08-05 10:19:44 -07:00
d1aaf33622 Merge pull request #7176 from mheon/make_entrypoint
Ensure WORKDIR from images is created
2020-08-05 14:48:28 +02:00
7a7c8e9911 Merge pull request #6905 from QiWang19/retry-pull
Retry pulling image
2020-08-05 10:53:49 +02:00
47971909ae Merge pull request #7125 from QiWang19/fd-validate
validate fds --preserve-fds
2020-08-05 09:37:59 +02:00
6260677012 Merge pull request #7224 from rhatdan/remove
Handle podman-remote run --rm
2020-08-05 04:14:22 +02:00
0a3f3c94f8 Merge pull request #7081 from QiWang19/sigature-store
fix bug podman sign storage path
2020-08-05 02:47:44 +02:00
ca2eccea4a Merge pull request #7217 from rhatdan/alias
Remove duplicated code
2020-08-05 02:44:58 +02:00
a0fb081003 Handle podman-remote run --rm
We need to remove the container after it has exited for
podman-remote run --rm commands.  If we don't remove this
container at this step, we open ourselves up to race conditions.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-04 20:26:34 -04:00
807efd6698 Merge pull request #7222 from baude/issue7128
correct go-binding key for volumes
2020-08-05 01:32:48 +02:00
7590a415d0 correct go-binding key for volumes
the go binding for remove container was using 'vols' for a key to remove volumes associated to the container.  the correct key should be "v" and is documented as such.

Fixes: #7128

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-08-04 15:31:51 -05:00
21421c8411 HACK HACK try debugging build
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-08-04 16:21:57 -04:00
42d756d77b Retry pulling image
Wrap the inner helper in the retry function. Functions pullimage failed with retriable error will default maxretry 3 times using exponential backoff.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-08-04 15:56:19 -04:00
69ac054ae6 fix bug podman sign storage path
- fix the bud podman not using specified --directory as signature storage.
- use manifest and image referce to set repo@digest.
close #6994
close #6993

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-08-04 15:10:47 -04:00
34e82f81bd validate fds --preserve-fds
validate file descriptors passed from podman run and podman exec --preserve-fds.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-08-04 15:09:17 -04:00
77d803d4fe Remove duplicated code
We have duplicated alias handling, removing.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-04 09:48:43 -04:00
d4cf3c589d Merge pull request #7207 from Luap99/pod/ctr-exists-error
Improve error message when creating a pod/ctr with the same name
2020-08-04 15:46:13 +02:00
93d63208bb Merge pull request #7203 from TomSweeneyRedHat/dev/tsweeney/bump_buildah
Bump to Buildah 1.16.0-dev in upstream
2020-08-04 15:01:22 +02:00
6aed1076a2 Merge pull request #7111 from edsantiago/reenable_remote_system_tests
Reenable remote system tests
2020-08-04 14:58:35 +02:00
7eca5571dc Merge pull request #7204 from baude/issue7197
Missing return after early exit
2020-08-04 14:16:40 +02:00
f7440ffaf6 Merge pull request #7205 from baude/issue7185
docker-compose uses application/tar
2020-08-04 12:20:25 +02:00
861702e026 Merge pull request #7192 from giuseppe/system-service-join-ns-immediately
rootless: system service joins immediately the namespaces
2020-08-04 12:17:34 +02:00
919e5d4d6e Merge pull request #7209 from giuseppe/support-mount-devpts
podman: support --mount type=devpts
2020-08-04 12:14:47 +02:00
97b2b07953 Improve error message when creating a pod/ctr with the same name
Check if there is an pod or container an return
the appropriate error message instead of blindly
return 'container exists' with `podman create` and
'pod exists' with `podman pod create`.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-08-04 11:39:27 +02:00
1ed1e583a0 Merge pull request #7201 from mheon/0000_is_empty
Do not set host IP on ports when 0.0.0.0 requested
2020-08-04 10:20:38 +02:00
976e364a97 podman: support --mount type=devpts
Allow to create a devpts mount.

This is useful for containers that bind mount /dev/ from the host but
at the same time want to create a terminal.

It can be used as:

podman run -v /dev:/dev --mount type=devpts,target=/dev/pts ...

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-08-03 23:05:10 +02:00
8df7ab24b0 rootless: system service joins immediately the namespaces
when there is a pause process running, let the "system service" podman
instance join immediately the existing namespaces.

Closes: https://github.com/containers/podman/issues/7180
Closes: https://github.com/containers/podman/issues/6660

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-08-03 22:08:17 +02:00
246603041c docker-compose uses application/tar
even though the official documentation suggests that application/x-tar should be used for tar files, it seems docker-compose uses application/tar.  we now accept them and issue a warning.

Fixes: #7185

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-08-03 14:19:21 -05:00