9991 Commits

Author SHA1 Message Date
22702b9d60 specgen: split cgroup v1 and cgroup v2 code
refactor function into two separate ones.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-30 14:46:43 +01:00
433fea303e specgen: fix error message
drop spurious comma.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-30 14:30:33 +01:00
ed9edf840a When container stops, drop sig-proxy errors to infos
The sig-proxy code is set up to error on failing to forward
signals to a container. This is reasonable in cases where the
container is running, but something strange went wrong - but when
the Kill fails because the container is stopped, we shouldn't
bother with aggressive Error logging since this is an expected
part of the container lifecycle - it stops, and then `podman run`
also stops, but there is a timing window in between where signals
will fail to be proxied, and we should not print angry errors
during that.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-10-30 09:23:47 -04:00
0ebee0ce8e Cirrus: Workaround F32 BFQ Kernel bug
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-30 09:15:56 -04:00
831d7fb0d7 Stop excessive wrapping of errors
Most of the builtin golang functions like os.Stat and
os.Open report errors including the file system object
path. We should not wrap these errors and put the file path
in a second time, causing stuttering of errors when they
get presented to the user.

This patch tries to cleanup a bunch of these errors.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-30 05:34:04 -04:00
916825b675 Pod's that share the IPC Namespace need to share /dev/shm
Containers that share IPC Namespaces share each others
/dev/shm, which means a private /dev/shm needs to be setup
for the infra container.

Added a system test and an e2e test to make sure the
/dev/shm is shared.

Fixes: https://github.com/containers/podman/issues/8181

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-30 05:21:34 -04:00
228396a99d Merge pull request #8174 from rhatdan/errors
Podman often reports OCI Runtime does not exist, even if it does
2020-10-29 22:21:17 +01:00
1ce5ece66f Merge pull request #8189 from mheon/further_fix_pull_flag
Fix the `--pull` flag to `podman build` to match Docker
2020-10-29 21:31:20 +01:00
c08e82aa25 Merge pull request #8186 from Luap99/fix-8184
Create the default root API address path
2020-10-29 19:31:24 +01:00
5180ec985d Fix the --pull flag to podman build to match Docker
The behavior should be as follows: Unset, pull if missing by
default, obey the `--pull-never` and `--pull-always` flags. Set
to false, pull never. Set to true, pull always.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-29 14:29:48 -04:00
222d8075ab Merge pull request #8085 from TomSweeneyRedHat/dev/tsweeney/fixpulls
Fix pull method selection
2020-10-29 19:06:51 +01:00
c8f0e1dab6 Merge pull request #8146 from vrothberg/image-mounts
new "image" mount type
2020-10-29 18:15:24 +01:00
d60a0ddcc1 Restore --format table header support
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-10-29 10:14:08 -07:00
e439aec4fa Merge pull request #8046 from cevich/simplify_environment
Cirrus: Simplify setting/passing env. vars.
2020-10-29 18:07:29 +01:00
6d72e7611e Merge pull request #8165 from edsantiago/move_from_dockerio
Move from docker.io
2020-10-29 18:00:33 +01:00
7485005206 Merge pull request #8178 from rhatdan/exists
NewFromLocal can return multiple images
2020-10-29 17:04:05 +01:00
12647ae33f Create the default root API address path
Fixes #8184

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-10-29 16:46:27 +01:00
b6aa9c1077 Merge pull request #8173 from giuseppe/improve-cannot-reexec-error
rootless: improve error message if cannot join namespaces
2020-10-29 16:15:30 +01:00
65a618886e new "image" mount type
Add a new "image" mount type to `--mount`.  The source of the mount is
the name or ID of an image.  The destination is the path inside the
container.  Image mounts further support an optional `rw,readwrite`
parameter which if set to "true" will yield the mount writable inside
the container.  Note that no changes are propagated to the image mount
on the host (which in any case is read only).

Mounts are overlay mounts.  To support read-only overlay mounts, vendor
a non-release version of Buildah.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-10-29 15:06:22 +01:00
3ba77a5618 Cirrus: Simplify setting/passing env. vars.
Test VMs by design are to be single-purpose, single-use, and
readily disposable.  Therefore it's unnecessary to overcomplicate
storage of runtime environment variables.  This commit makes these
points clear, and reorganizes all CI-related env. vars on the system
into a single location, `/etc/ci_environment`.  This file is then
automatically loaded, and variables exported, (by `lib.sh`) from
`runner.sh` prior to executing all forms of testing.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-29 09:02:31 -04:00
fdd32604cf Merge pull request #8161 from afbjorklund/podman-remote-host-hash
Support hashed hostnames in the known_hosts file
2020-10-29 06:31:20 -04:00
0f191ad72c Podman often reports OCI Runtime does not exist, even if it does
When the OCI Runtime tries to set certain settings in cgroups
it can get the error "no such file or directory",  the wrapper
ends up reporting a bogus error like:

```
 Request Failed(Internal Server Error): open io.max: No such file or directory: OCI runtime command not found error
{"cause":"OCI runtime command not found error","message":"open io.max: No such file or directory: OCI runtime command not found error","response":500}
```

On first reading of this, you would think the OCI Runtime (crun or runc) were not found.  But the error is actually reporting

message":"open io.max: No such file or directory

Which is what we want the user to concentrate on.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-29 06:19:21 -04:00
cfc41b32fd rootless: improve error message if cannot join namespaces
if podman failed to join the rootless namespaces, give users a better
errror message and possible solution.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1891220

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-29 08:49:40 +01:00
cce6c6cd40 Merge pull request #8163 from giuseppe/clean-path
libpod: clean paths before check
2020-10-29 03:31:19 -04:00
464aa36b0c Merge pull request #8081 from mheon/pod_degraded
Add a Degraded state to pods
2020-10-28 16:10:33 -04:00
99d3e2e9d7 NewFromLocal can return multiple images
If you use additional stores and pull the same image into
writable stores, you can end up with the situation where
you have the same image twice. This causes image exists
to return the wrong error.  It should return true in this
situation rather then an error.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-28 16:02:53 -04:00
6ad768852a libpod: clean paths before check
clean the paths before checking whether its value is different than
what is stored in the db.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-10-28 20:49:03 +01:00
20e104351d move from docker.io
Followon to #7965 (mirror registry). mirror.gcr.io doesn't
cache all the images we need, and I can't find a way to
add to its cache, so let's just use quay.io for those
images that it can't serve.

Tools used:
  skopeo copy --all docker://docker.io/library/alpine:3.10.2 \
                    docker://quay.io/libpod/alpine:3.10.2

...and also:

    docker.io/library/alpine:3.2
    docker.io/library/busybox:latest
    docker.io/library/busybox:glibc
    docker.io/library/busybox:1.30.1
    docker.io/library/redis:alpine
    docker.io/libpod/alpine-with-bogus-seccomp:label
    docker.io/libpod/alpine-with-seccomp:label
    docker.io/libpod/alpine_healthcheck:latest
    docker.io/libpod/badhealthcheck:latest

Since most of those were new quay.io/libpod images, they required
going in through the quay.io GUI, image, settings, Make Public.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-28 13:16:37 -06:00
e04e567b96 Merge pull request #8175 from mheon/interactive_attach_chan
Ensure that attach ready channel does not block
2020-10-28 14:53:34 -04:00
53fe386da0 Cirrus: Use google mirror for docker.io
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-28 12:25:53 -06:00
5d48606dae Cirrus: Always record runc/crun versions
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-28 12:24:06 -06:00
2cf443fd41 Ensure that attach ready channel does not block
We only use this channel in terminal attach, and it was not a
buffered channel originally, so it would block on trying to send
unless a receiver was ready. In the non-terminal case, there was
no receiver, so attach blocked forever. Buffer the channel for a
single bool so that it will never block, even if unused.

Fixes #8154

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-10-28 11:32:31 -04:00
4d87306fbe Merge pull request #8157 from rhatdan/volumes
Add test cases to cover podman volume
2020-10-28 08:55:16 -04:00
7149a7cb39 Merge pull request #8102 from ashley-cui/inspect
Add pod, volume, network to inspect package
2020-10-27 17:04:44 -04:00
63efde15f1 Add a way to retrieve all network aliases for a ctr
The original interface only allowed retrieving aliases for a
specific network, not for all networks. This will allow aliases
to be retrieved for every network the container is present in,
in a single DB operation.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-27 15:50:03 -04:00
26c09291a3 Merge pull request #8121 from baude/clioptsresources
set resources only when specified
2020-10-27 15:24:58 -04:00
61deec451f Add pod, volume, network to inspect package
podman inspect only had the capabilities to inspect containers and images. if a user wanted to inspect a pod, volume, or network, they would have to use `podman network inspect`, `podman pod inspect` etc. Docker's cli allowed users to inspect both volumes and networks using regular inspect, so this commit gives the user the functionality

If the inspect type is not specified using --type, the order of inspection is:

containers
images
volumes
networks
pods

meaning if container that has the same name as an image, podman inspect would return the container inspect.

To avoid duplicate code, podman network inspect and podman volume inspect now use the inspect package as well. Podman pod inspect does not because podman pod inspect returns a single json object while podman inspect can return multiple)

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-10-27 14:42:54 -04:00
6af7e54463 Add network aliases for containers to DB
This adds the database backend for network aliases. Aliases are
additional names for a container that are used with the CNI
dnsname plugin - the container will be accessible by these names
in addition to its name. Aliases are allowed to change over time
as the container connects to and disconnects from networks.

Aliases are implemented as another bucket in the database to
register all aliases, plus two buckets for each container (one to
hold connected CNI networks, a second to hold its aliases). The
aliases are only unique per-network, to the global and
per-container aliases buckets have a sub-bucket for each CNI
network that has aliases, and the aliases are stored within that
sub-bucket. Aliases are formatted as alias (key) to container ID
(value) in both cases.

Three DB functions are defined for aliases: retrieving current
aliases for a given network, setting aliases for a given network,
and removing all aliases for a given network.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-27 14:17:41 -04:00
ee29328abc Merge pull request #8141 from afbjorklund/podman-remote-host-port-master
Add support for host keys for non-22 ports
2020-10-27 13:30:13 -04:00
95f3ec7b08 Merge pull request #8133 from xordspar0/cpu-limit-details
[CI:DOCS] Add more details about how CPU limits work
2020-10-27 13:26:53 -04:00
434de069fe Merge pull request #8134 from xordspar0/cpu.max-permission
[CI:DOCS] Document how to enable CPU limit delegation
2020-10-27 13:23:27 -04:00
eda5a6d069 Merge pull request #8145 from containers/dependabot/go_modules/github.com/containers/common-0.26.2
Bump github.com/containers/common from 0.26.0 to 0.26.3
2020-10-27 13:20:07 -04:00
b8641aec36 Add test cases to cover podman volume
Add test cases to cover below podman volume subcommand:
  create
  ls
  inspect
  rm
  prune

Signed-off-by: Yuhui Jiang <yujiang@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-27 13:16:04 -04:00
cef85763e5 Merge pull request #8164 from Luap99/journal-events
Improve the journal event reading
2020-10-27 17:07:45 +01:00
f393d32e96 Document how to enable CPU limit delegation
Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-10-27 10:05:43 -05:00
fa73b929e0 Add more details about how CPU limits work
Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-10-27 09:32:41 -05:00
5d3042c4fb set resources only when specified
when using the compatibility endpoint to create a container, we should only set certain resources when we are provided a value for them or we result in fields with zero values.

Signed-off-by: baude <bbaude@redhat.com>
2020-10-27 09:18:59 -05:00
0f0d857f6c Merge pull request #8151 from vrothberg/fix-8148
image list: check for all errors
2020-10-27 14:29:41 +01:00
692559c8c5 Improve the journal event reading
Fix the AddMatch/SeekTail conflict. This prevents reading
unnecessary journal entries which could cause errors.

Also wrap the sdjournal errors to provide better error messages.

Fixes #8125

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-10-27 14:10:55 +01:00
2099c86f33 build(deps): bump github.com/containers/common from 0.26.0 to 0.26.3
Bumps [github.com/containers/common](https://github.com/containers/common) from 0.26.0 to 0.26.3.
- [Release notes](https://github.com/containers/common/releases)
- [Commits](containers/common@v0.26.0...v0.26.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-27 07:25:23 -04:00