Commit graph

10680 commits

Author SHA1 Message Date
OpenShift Merge Robot
2b89fe7d5d
Merge pull request #9287 from vrothberg/3.0-vendor-image
[3.0] vendor github.com/containers/image v5.10.2
2021-02-09 15:00:14 -05:00
OpenShift Merge Robot
1112f8566d
Merge pull request #9285 from jwhonce/issues/8773-v3.0.0
Add default template functions
2021-02-09 14:34:12 -05:00
Valentin Rothberg
721d4b5ffc vendor github.com/containers/image v5.10.2
Fixes: #8559
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-09 17:57:48 +01:00
Jhon Honce
27c016633b Add default template functions
For commands that use the golang template library directly add the
compatible template functions

Fixes #8773

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-02-09 08:46:17 -07:00
OpenShift Merge Robot
a5ab59ede7
Merge pull request #9273 from mheon/backport_api_changes
[v3.0] Backport final breaking API change to v3.0
2021-02-08 17:48:06 -05:00
Matej Vasek
f645880ecd Fix per review request
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-08 14:29:46 -05:00
Matej Vasek
2df59dece5 Increase timeouts in some tests
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-08 14:29:39 -05:00
Matej Vasek
5397737edc Add test for Docker APIv2 wait
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-08 14:29:31 -05:00
Matej Vasek
9fc22932a6 Implement Docker wait conditions
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-08 14:29:24 -05:00
Matej Vasek
d6625f2948 Improve ContainerEngine.ContainerWait()
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-08 14:29:18 -05:00
Matej Vasek
74db6e7ed3 Improve container libpod.Wait*() functions
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-08 14:29:10 -05:00
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