Commit graph

10669 commits

Author SHA1 Message Date
Matej Vasek
d451aed9fe [NO TESTS NEEDED] style: indendation
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-08 14:28:28 -05:00
Matej Vasek
500874d2e2 [NO TESTS NEEDED] fixup: remove debug code
Signed-off-by: Matej Vasek <mvasek@redhat.com>

<MH: Regenerate bindings>

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-02-08 14:14:37 -05:00
Matej Vasek
598d205167 [NO TESTS NEEDED] Generated files
Signed-off-by: Matej Vasek <mvasek@redhat.com>

<MH: Regenerated bindings>

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-02-08 14:06:50 -05:00
Daniel J Walsh
b51933d564 Cleanup bindings for image pull
Remove bindings that are not handled over the API.

Leaving this one to not use image pull, since this would
break progress handling.  We should revisit this in the
future.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-08 14:04:26 -05:00
Matej Vasek
793a1e0f4d [NO TESTS NEEDED] Improve generator
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-08 14:00:05 -05:00
Daniel J Walsh
d620a77c67 Fix invalid wait condition on kill
When using the compatability tests on kill, the kill
function goes into an infinite wait loop taking all of the CPU.

This change will use the correct wait function and exit properly.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-08 13:59:12 -05:00
Daniel J Walsh
7819e49353 Switch podman image push handlers to use abi
Change API Handlers to use the same functions that the
local podman uses.

At the same time:

Cleanup and pass proper bindings.  Remove cli options from
podman-remote push.  Cleanup manifest push.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-08 13:58:49 -05:00
Daniel J Walsh
0838a9414d podman-remote ps --external --pod --sort do not work.
Fixup the bindings and the handling of the --external --por and --sort
flags.

The --storage option was renamed --external, make sure we use
external up and down the stack.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-08 13:58:36 -05:00
Daniel J Walsh
5da474dec0 Fix --arch and --os flags to work correctly
Currently podman implements --override-arch and --overide-os
But Podman has made these aliases for --arch and --os.  No
reason to have to specify --override, since it is clear what
the user intends.

Currently if the user specifies an --override-arch field but the
image was previously pulled for a different Arch, podman run uses
the different arch.  This PR also fixes this issue.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-08 13:58:10 -05:00
Daniel J Walsh
7c05d5292b Switch podman stop/kill/wait handlers to use abi
Change API Handlers to use the same functions that the
local podman uses.

At the same time:

 implement remote API for --all and --ignore flags for podman stop
 implement remote API for --all flags for podman stop

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-08 13:57:57 -05:00
Daniel J Walsh
efcffde620 Fix handling of container remove
I found several problems with container remove

podman-remote rm --all
Was not handled

podman-remote rm --ignore
Was not handled

Return better errors when attempting to remove an --external container.
Currently we return the container does not exists, as opposed to container
is an external container that is being used.

This patch also consolidates the tunnel code to use the same code for
removing the container, as the local API, removing duplication of code
and potential problems.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-08 13:57:45 -05:00
OpenShift Merge Robot
bcf7d4383d
Merge pull request #9267 from mheon/bump_300_rc3
Bump to v3.0.0-RC3
2021-02-08 11:20:33 -05:00
Matthew Heon
b30100feab Bump to v3.0.0-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-02-08 09:22:56 -05:00
Matthew Heon
17338e841b
Bump to v3.0.0-RC3
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-02-08 09:18:23 -05:00
OpenShift Merge Robot
288fb68896
Merge pull request #9237 from mheon/backports_300_RC3
Backports for v3.0,0-RC3
2021-02-05 17:24:34 -05:00
OpenShift Merge Robot
9e2cdc4a84
Merge pull request #9244 from rhatdan/v3.0
Bump to containers/common v0.33.4
2021-02-05 14:34:55 -05:00
OpenShift Merge Robot
7597fa47b9
Merge pull request #9242 from lsm5/v3.0
[backport v3.0] Bump github.com/containernetworking/cni from 0.8.0 to 0.8.1
2021-02-05 14:28:19 -05:00
Matthew Heon
c5c946b18f Further release notes for v3.0
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-02-05 14:20:08 -05:00
Matthew Heon
6c5e9d2f0a Bump remote API version to 3.0.0
Fixes #9175

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-02-05 13:56:49 -05:00
Valentin Rothberg
353c3b04d1 fix logic when not creating a workdir
When resolving the workdir of a container, we may need to create unless
the user set it explicitly on the command line.  Otherwise, we just do a
presence check.  Unfortunately, there was a missing return that lead us
to fall through into attempting to create and chown the workdir.  That
caused a regression when running on a read-only root fs.

Fixes: #9230
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-05 13:55:15 -05:00
Steven Taylor
9cf6b7f8dc play kube selinux test case
added skip to test case where selinux not enabled

Signed-off-by: Steven Taylor <steven@taylormuff.co.uk>
2021-02-05 13:53:04 -05:00
Steven Taylor
c9a6e6eaf3 play kube selinux test case
fixed typo in the label comparison

Signed-off-by: Steven Taylor <steven@taylormuff.co.uk>
2021-02-05 13:52:58 -05:00
Steven Taylor
204239169a play kube selinux label test case
test case added to e2e test suite to validate process label being correctly set
on play kube

Signed-off-by: Steven Taylor <steven@taylormuff.co.uk>
2021-02-05 13:52:49 -05:00
Steven Taylor
572b0803c7 play kube selinux label issue
play kube function not respecting selinux options in kube yaml, all options were
being mapped to role.

fixes issue 8710

Signed-off-by: Steven Taylor <steven@taylormuff.co.uk>
2021-02-05 13:52:41 -05:00
Paul Holzinger
951879c690 Fix podman network disconnect wrong NetworkStatus number
The allocated `tmpNetworkStatus` must be allocated with the length 0.
Otherwise append would add new elements to the end of the slice and
not at the beginning of the allocated memory.

This caused inspect to fail since the number of networks did not
matched the number of network statuses.

Fixes #9234

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-05 13:50:48 -05:00
Daniel J Walsh
e3348e9052
Bump to v0.33.4
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-05 12:03:35 -05:00
dependabot-preview[bot]
ce4265af83 Bump github.com/containernetworking/cni from 0.8.0 to 0.8.1
Bumps [github.com/containernetworking/cni](https://github.com/containernetworking/cni) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/containernetworking/cni/releases)
- [Commits](https://github.com/containernetworking/cni/compare/v0.8.0...v0.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Backport to v3.0
(cherry picked from commit 9dc7951915)
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2021-02-05 11:37:23 -05:00
Matthew Heon
4793bf8ac2 Update release notes for v3.0.0-RC3
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-02-04 16:08:38 -05:00
Valentin Rothberg
d6ba4ab098 generate kube: handle entrypoint
The spec of a Kube Container has a `Command` and `Args`.  While both are
slices, the `Command` is the counterpart of the entrypoint of a libpod
container.  Kube is also happily accepting the arguments to as following
items in the slice but it's cleaner to move those to `Args`.

Fixes: #9211
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-04 16:06:54 -05:00
Matthew Heon
6bd3a6bcab Allow pods to use --net=none
We need an extra field in the pod infra container config. We may
want to reevaluate that struct at some point, as storing network
modes as bools will rapidly become unsustainable, but that's a
discussion for another time. Otherwise, straightforward plumbing.

Fixes #9165

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-02-04 14:26:57 -05:00
Jhon Honce
b576ddd9a2 Report StatusConflict on Pod opt partial failures
- When one or more containers in the Pod reports an error on an operation
report StatusConflict and report the error(s)

- jsoniter type encoding used to marshal error as string using error.Error()

- Update test framework to allow setting any flag when creating pods

- Fix test_resize() result check

Fixes #8865

Signed-off-by: Jhon Honce <jhonce@redhat.com>

<MH: Fix cherry-pick conflicts>

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-02-04 14:24:26 -05:00
Valentin Rothberg
6213225c91 bindings: attach: warn correct error
The resize warning logged the wrong error.  While this does not fix
 #9172, it may very well be helpful finding its root cause.

[NO TESTS NEEDED]

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-04 14:21:56 -05:00
bitstrings
6d9217228b Make slirp MTU configurable (network_cmd_options)
The mtu default value is currently forced to 65520.
This let the user control it using the config key network_cmd_options,
i.e.: network_cmd_options=["mtu=9000"]

Signed-off-by: bitstrings <pino.silvaggio@gmail.com>
2021-02-04 14:19:00 -05:00
Paul Holzinger
3b712d9615 Fix podman generate systemd --new special char handling
In a systemd unit dollar and percent signs are used for variables. A backslash
is used for escape sequences. If any of these characters are used in the create
command we have to properly escape them so systemd does not try to interpret them.

Fixes #9176

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-04 13:52:47 -05:00
Paul Holzinger
be6afd10d9 Fix --network parsing for podman pod create
The `--network` flag is parsed differently for `podman pod create`.
This causes confusion and problems for users. The extra parsing
logic ignored unsupported network options such as `none`,
`container:...` and `ns:...` and instead interpreted them as cni
network names.

Tests are added to ensure the correct errors are shown.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-04 13:52:26 -05:00
Milivoje Legenovic
f4c828f827 Endpoint that lists containers does not return correct Status value
Eclipse and Intellij Docker plugin determines the state of the
container via the Status field, returned from /containers/json call.
Podman always returns empty string, and because of that, both IDEs
show the wrong state of the container.

Signed-off-by: Milivoje Legenovic <m.legenovic@gmail.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-02-04 13:49:21 -05:00
Daniel J Walsh
8defc9cf43 Docker ignores mount flags that begin with constency
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1915332

```
According to the Docker docs, the consistency option should be ignored on Linux.

the possible values are 'cached', 'delegated', and 'consistent', but they should be ignored equally.

This is a widely used option in scripts run by developer machines, as this makes file I/O less horribly slow on MacOS.
```

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-04 13:45:33 -05:00
Milivoje Legenovic
f5eeee1103 podman generate kube ignores --network=host
Signed-off-by: Milivoje Legenovic <m.legenovic@gmail.com>
2021-02-04 13:42:54 -05:00
baude
c749515745 Honor custom DNS in play|generate kube
when creating kubernetes yaml from containers and pods, we should honor
any custom dns settings the user provided. in the case of generate kube,
these would be provided by --dns, --dns-search, and --dns-opt. if
multiple containers are involved in the generate, the options will be
cumulative and unique with the exception of dns-opt.

when replaying a kube file that has kubernetes dns information, we now
also add that information to the pod creation.

the options for dnspolicy is not enabled as there seemed to be no direct
correlation between kubernetes and podman.

Fixes: #9132

Signed-off-by: baude <bbaude@redhat.com>
2021-02-04 13:35:53 -05:00
Daniel J Walsh
b9c8c43c45 Don't fail if one of the cgroups is not setup
It is fairly common for certain cgroups controllers to
not be enabled on a system.  We should Warn when this happens
versus failing, when doing podman stats command.  This way users
can get information from the other controllers.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-04 13:31:40 -05:00
Gerard Braad
5cfe809ef2 Fix #9100 Change console mode message to debug
[NO TESTS NEEDED]

Signed-off-by: Gerard Braad <me@gbraad.nl>
2021-02-04 13:29:21 -05:00
Matthew Heon
6913e1466b Update release notes from master
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-02-04 13:24:04 -05:00
OpenShift Merge Robot
82081e8112
Merge pull request #9225 from mheon/fix_CVE-2021-20199_30
Fix CVE-2021-20199 for Podman v3.0
2021-02-03 17:36:36 -05:00
Giuseppe Scrivano
f11aabd3e0 libpod: move slirp magic IPs to consts
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-02-03 15:46:35 -05:00
Giuseppe Scrivano
5172cfe6a5 rootlessport: set source IP to slirp4netns device
set the source IP to the slirp4netns address instead of 127.0.0.1 when
using rootlesskit.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-02-03 15:46:26 -05:00
Matthew Heon
4dbcb1f925 Bump rootless-containers/rootlesskit to v0.12.0
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-02-03 15:43:44 -05:00
OpenShift Merge Robot
c2a298ea93
Merge pull request #9213 from edsantiago/bats_diff_workaround_v3
[v3.0] Gating tests: diff test: workaround for RHEL8 failure
2021-02-03 09:31:45 -05:00
Ed Santiago
78036f92a2 Gating tests: diff test: workaround for RHEL8 failure
RHEL8 rootless gating tests are inconsistently failing with:

   $ podman diff --format json -l
   #
   {"changed":["/etc"],"added":["/sys/fs","/sys/fs/cgroup","/pMOm1Q0fnN"],"deleted":["/etc/services"]}
   # #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
   # #|     FAIL: added
   # #| expected: '/pMOm1Q0fnN'
   # #|   actual: '/sys/fs'
   # #|         > '/sys/fs/cgroup'
   # #|         > '/pMOm1Q0fnN'
   # #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Reason: PR #8561, I think (something to do with /sys on RHEL).

Workaround: ignore '/sys/fs' in diffs.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-02-03 05:25:17 -07:00
OpenShift Merge Robot
013770ef14
Merge pull request #9187 from rhatdan/v3.0
Bump to containers/common v0.33.2
2021-02-03 06:46:22 -05:00
Daniel J Walsh
06fe589a0f
Bump to containers/common v0.33.3
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-02 14:31:02 -05:00