Commit graph

10601 commits

Author SHA1 Message Date
Matthew Heon
07f2df472c Ensure shutdown handler access is syncronized
There was a potential race where two handlers could be added at
the same time. Go Maps are not thread-safe, so that could do
unpleasant things. Add a mutex to keep things safe.

Also, swap the order or Register and Start for the handlers in
Libpod runtime created. As written, there was a small gap between
Start and Register where SIGTERM/SIGINT would be completely
ignored, instead of stopping Podman. Swapping the two closes this
gap.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-01-29 15:24:24 -05:00
Valentin Rothberg
c48753bfa0 workdir presence checks
A container's workdir can be specified via the CLI via `--workdir` and
via an image config with the CLI having precedence.

Since images have a tendency to specify workdirs without necessarily
shipping the paths with the root FS, make sure that Podman creates the
workdir.  When specified via the CLI, do not create the path, but check
for its existence and return a human-friendly error.

NOTE: `crun` is performing a similar check that would yield exit code
127.  With this change, however, Podman performs the check and yields
exit code 126.  Since this is specific to `crun`, I do not consider it
to be a breaking change of Podman.

Fixes: #9040
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-29 15:24:04 -05:00
Valentin Rothberg
0b500515d8 libpod: add (*Container).ResolvePath()
Add an API to libpod to resolve a path on the container.  We can
refactor the code that was originally written for copy.  Other
functions are requiring a proper path resolution, so libpod seems
like a reasonable home for sharing that code.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-29 15:23:56 -05:00
baude
2393dd304d Add default net info in container inspect
when inspecting a container that is only connected to the default
network, we should populate the default network in the container inspect
information.

Fixes: #6618

Signed-off-by: baude <bbaude@redhat.com>

MH: Small fixes, added another test

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-01-29 15:23:24 -05:00
Paul Holzinger
b4aa54c756 Fix podman history --no-trunc for the CREATED BY field
Fixes #9120

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-29 15:23:10 -05:00
Matthew Heon
bb88db783c Ensure the Volumes field in Compat Create is honored
Docker has, for unclear reasons, three separate fields in their
Create Container struct in which volumes can be placed. Right now
we support two of those - Binds and Mounts, which (roughly)
correspond to `-v` and `--mount` respectively. Unfortunately, we
did not support the third, `Volumes`, which is used for anonymous
named volumes created by `-v` (e.g. `-v /test`). It seems that
volumes listed here are *not* included in the remaining two from
my investigation, so it should be safe to just append them into
our handling of the `Binds` (`-v`) field.

Fixes #8649

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-01-29 15:22:57 -05:00
Valentin Rothberg
5747fd71c9 remote exec: write conmon error on hijacked connection
Make sure to write error from conmon on the hijacked http connection.
This fixes issues where errors were not reported on the client side,
for instance, when specified command was not found on the container.

To future generations: I am sorry.  The code is complex, and there are
many interdependencies among the concurrent goroutines.  I added more
complexity on top but I don't have a good idea of how to reduce
complexity in the available time.

Fixes: #8281
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-29 15:22:10 -05:00
OpenShift Merge Robot
b633607110
Merge pull request #9141 from Luap99/v3-rootless-cni
[v3.0] Add support for rootless network-aliases and static ip/mac
2021-01-29 11:38:21 -05:00
Paul Holzinger
e42f9ee697 Add support for rootless network-aliases
Make sure we pass the network aliases as capability args to the
cnitool in the rootless-cni-infra container. Also update the
dnsname plugin in the cni-infra container.

Fixes #8567

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-28 11:33:29 +01:00
Paul Holzinger
2b97c1d733 Allow static ip and mac with rootless cni network
Make sure we pass the ip and mac address as CNI_ARGS to
the cnitool which is executed in the rootless-cni-infra
container.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-28 11:33:29 +01:00
OpenShift Merge Robot
4dbb58d637
Merge pull request #9107 from baude/v3backportdnsnameinternal
[3.0] disable dnsname when --internal
2021-01-26 21:25:41 +01:00
OpenShift Merge Robot
dc2f4c63ef
Merge pull request #9112 from baude/v3.0correctpath
[CI:DOCS]Correct static API html path
2021-01-26 20:00:49 +01:00
baude
9a8576fca9 [CI:DOCS]Correct static API html path
Correct the path from the reference.rst to the static api documentation.

Signed-off-by: baude <bbaude@redhat.com>
2021-01-26 12:32:01 -06:00
baude
7e88a57955 disable dnsname when --internal
when doing a network creation, the dnsname plugin should be disabled
when the --internal bool is set.  a warning is displayed if this
happens and docs are updated.

Signed-off-by: baude <bbaude@redhat.com>
2021-01-26 12:24:09 -06:00
Paul Holzinger
8dc389ec5a Use random network names in the e2e tests
Unlike the container storage all e2e test are using the same cni
config directory. This causes problems if the network name already
exists. Using random names will make the second run pass even if the
first failed. This is only done to prevent full CI failures.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-26 12:24:01 -06:00
OpenShift Merge Robot
44bd963309
Merge pull request #9108 from edsantiago/fix_rhel_sys_gating_tests
[v3.0] fix RHEL gating test: the /sys thing
2021-01-26 19:16:45 +01:00
Ed Santiago
377c412768 [v3.0] fix RHEL gating test: the /sys thing
Backport one component of #9091 in hopes of fixing RHEL8
gating test failures.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-01-26 08:13:09 -07:00
OpenShift Merge Robot
715a7518a7
Merge pull request #9097 from TomSweeneyRedHat/crypto_v3.0
Bump golang.org/x/crypto v3.0
2021-01-26 11:19:56 +01:00
TomSweeneyRedHat
87f5701b9c Bump golang.org/x/crypto v3.0
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2021-01-25 21:22:50 -05:00
OpenShift Merge Robot
469c2031fc
Merge pull request #9055 from baude/v3backportcomposelog
[3.0] Set log driver for compatability containers
2021-01-21 13:56:17 -05:00
OpenShift Merge Robot
ac4ccdc3f1
Merge pull request #9043 from cevich/no_smoke_branches
[v3.0] [CI:DOCS] Cirrus: Skip smoke task on branch-push
2021-01-21 13:23:35 -05:00
baude
22d2caeeb1 Set log driver for compatability containers
when using the compatibility api to create containers, now reflect the
use of k8s-file as json-file so that clients, which are
unaware of k8s-file, can work.  specifically, if the container is using
k8s-file as the log driver, we change the log type in container
inspection to json-file.  These terms are used interchangably in other
locations in libpod/podman.

this fixes log messages in compose as well.

[NO TESTS NEEDED]

Signed-off-by: baude <bbaude@redhat.com>
2021-01-21 10:22:36 -06:00
Chris Evich
4c605238c7
[CI:DOCS] Cirrus: Skip smoke task on branch-push
There is no need to re-run the same basic validation checks as were
presumably already run on a PR before it merged.  There are also
possible problems properly determining `$EPOCH_TEST_COMMIT` when
there have been no successful CI-runs on the branch (i.e. it's new).
This needlessly fouls up the git-validation tool.  Fix Both problems
by just skipping the 'smoke' task for branches and tags.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-20 15:02:07 -05:00
OpenShift Merge Robot
4ecd2be083
Merge pull request #9039 from baude/v3backportnocomposeci
[CI:DOCS]Do not run compose tests with CI:DOCS
2021-01-20 14:31:29 -05:00
OpenShift Merge Robot
674a94bcb3
Merge pull request #9038 from baude/v3backportbindingopts
Add binding options for container|pod exists
2021-01-20 13:26:05 -05:00
baude
20c56cc848 [CI:DOCS]Do not run compose tests with CI:DOCS
Signed-off-by: baude <bbaude@redhat.com>
2021-01-20 08:47:56 -06:00
baude
38bb4b21af Add binding options for container|pod exists
It turns out an options was added to container exists so it makes sense
to have pods and container exists calls have an optional structure for
options.

Signed-off-by: baude <bbaude@redhat.com>
2021-01-20 08:36:41 -06:00
OpenShift Merge Robot
ade8a92d16
Merge pull request #9013 from edsantiago/release_deal_with_set_minus_e--3.0
[v3.0] runner.sh : deal with bash 'set -e'
2021-01-19 01:50:26 -05:00
Ed Santiago
46df46ab60 runner.sh : deal with bash 'set -e'
Release trigger script failed[1] because the entire script
runs under 'set -e'; so a 'grep -- -dev' that finds no
results will cause a nonzero exit status and hence the
entire script to fail. Work around that.

 [1] https://cirrus-ci.com/task/4541290882793472

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-01-18 15:13:36 -07:00
OpenShift Merge Robot
c176510de6
Merge pull request #9011 from baude/rtdversion
[CI:DOCS]Add readthedoc link for 3.0 docs
2021-01-18 15:42:59 -05:00
baude
36b084170a [CI:DOCS]Add readthedoc link for 3.0 docs
renamed the static api documentation and moved it into the documentation
directory.  then added a link on the reference page to it. this should
give us versioned api documentation.

Signed-off-by: baude <bbaude@redhat.com>
2021-01-18 13:05:13 -06:00
OpenShift Merge Robot
eaf6a4f2fa
Merge pull request #9005 from baude/v3apidocs
[CI:DOCS]Add static HTML for api docs for v3.0
2021-01-18 13:01:44 -05:00
baude
0356c46e53 [CI:DOCS]Add static HTML for api docs for v3.0
Manually generated static documentation for the API.

Signed-off-by: baude <bbaude@redhat.com>
2021-01-18 10:01:05 -06:00
OpenShift Merge Robot
bfaf1713e9
Merge pull request #8997 from rhatdan/v3.0
Bump to v3.0.0-rc1
2021-01-18 10:04:54 -05:00
Daniel J Walsh
1cbe815ee7
Bump to v3.0.0-rc1
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-18 06:55:38 -05:00
OpenShift Merge Robot
0030a23777
Merge pull request #8992 from rhatdan/push
[ci:docs] Create release notes for V3.0.0
2021-01-17 15:26:47 -05:00
Daniel J Walsh
46c87f6711
Create release notes for V3.0.0
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-17 07:48:52 -05:00
OpenShift Merge Robot
341c4b1fd9
Merge pull request #8942 from rhatdan/push
Allow podman push to push manifest lists
2021-01-17 06:52:35 -05:00
OpenShift Merge Robot
73b036db56
Merge pull request #8988 from Luap99/rename-port-completion-func
[CI:DOCS] Rename AutocompletePortCommand func
2021-01-16 18:17:38 -05:00
Paul Holzinger
47eeb02c7a Rename AutocompletePortCommand func
This function is now used for the port and rename command.
Rename it to AutocompleteContainerOneArg.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-16 18:54:59 +01:00
OpenShift Merge Robot
83ed464d29
Merge pull request #8986 from baude/bindingreadme
[CI:DOCS]Add README.md for golang bindings
2021-01-15 13:58:27 -05:00
OpenShift Merge Robot
f43f209ca4
Merge pull request #8456 from kazimsarikaya/fix-send-tar
podman remote send tar
2021-01-15 13:49:27 -05:00
OpenShift Merge Robot
53ecda2981
Merge pull request #8949 from giuseppe/sysfs-for-rootless
specgen: improve heuristic for /sys bind mount
2021-01-15 13:38:30 -05:00
Daniel J Walsh
cf51c7ed9f
Allow podman push to push manifest lists
When doing a podman images, manifests lists look just like images, so
it is logical that users would assume that they can just podman push them
to a registry.  The problem is we throw out weird errors when this happens
and users need to somehow figure out this is a manifest list rather then
an image, and frankly the user will not understand the difference.

This PR will make podman push just do the right thing, by failing over and
attempting to push the manifest if it fails to push the image.

Fix up handling of manifest push

Protocol should bring back a digest string, which can either be
printed or stored in a file.

We should not reimplement the manifest push setup code in the tunnel
code but take advantage of the api path, to make sure remote and local
work the same way.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-15 13:24:34 -05:00
baude
f59c29a6d7 [CI:DOCS]Add README.md for golang bindings
Add a brief description of the golang bindings and provide examples on
how to use them

Signed-off-by: baude <bbaude@redhat.com>
2021-01-15 10:49:40 -06:00
OpenShift Merge Robot
0400dc0a00
Merge pull request #8983 from rhatdan/test
Turn on podman pod stats test for rootless cgroup v2
2021-01-15 11:47:48 -05:00
OpenShift Merge Robot
7d3a628c6b
Merge pull request #8982 from Luap99/container-rename-bindings
Container rename bindings
2021-01-15 10:48:27 -05:00
Daniel J Walsh
7a30e82220
Turn on podman pod stats test for rootless cgroup v2
These tests should only be blocked for cgroups V1

Fixes: https://github.com/containers/podman/issues/8734
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-15 09:24:28 -05:00
OpenShift Merge Robot
5a166b2973
Merge pull request #8978 from rhatdan/buildah
Bump to containers/buildah 1.9.2
2021-01-15 09:23:57 -05:00
OpenShift Merge Robot
3ceef004e3
Merge pull request #8981 from containers/dependabot/go_modules/github.com/google/uuid-1.1.5
Bump github.com/google/uuid from 1.1.4 to 1.1.5
2021-01-15 08:43:27 -05:00