8426 Commits

Author SHA1 Message Date
1060a94efb Merge pull request #6568 from giuseppe/fix-check-for-rootless-net
libpod: fix check for slirp4netns netns
2020-06-11 08:55:50 -04:00
2ffb703d1b Fix builds for RDO
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-11 08:55:19 -04:00
b62e50f53b Merge pull request #6256 from theunrealgeek/play_kube_deployment
Support k8s Deployment in play kube
2020-06-11 08:53:00 -04:00
09e4faa7df Merge pull request #6529 from mheon/v6_ports
Enable IPv6 port binding
2020-06-11 08:50:13 -04:00
edeccb678f podman: create scope only if --cgroup-manager=systemd
drop check for current cgroup ownership if the cgroup manager is not
set to systemd.

Closes: https://github.com/containers/libpod/issues/4483

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-11 13:28:05 +02:00
8ef1b461ae libpod: fix check for slirp4netns netns
fix the check for c.state.NetNS == nil.  Its value is changed in the
first code block, so the condition is always true in the second one
and we end up running slirp4netns twice.

Closes: https://github.com/containers/libpod/issues/6538

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-11 13:06:26 +02:00
c7c81a8c08 e2e: sanity check --infra-conmon-pidfile
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
05713fbbf3 generate systemd: wrap pod/ctr lookup errors
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
139f82933d docs: create/run fix --pod-id-file description
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
8d8746adee generate systemd: create pod template
Create a new template for generating a pod unit file. Eventually, this
allows for treating and extending pod and container generation
seprately.

The `--new` flag now also works on pods.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
35ae53067f generate systemd: refactor
Refactor the systemd-unit generation code and move all the logic into
`pkg/systemd/generate`.  The code was already hard to maintain but I
found it impossible to wire the `--new` logic for pods in all the chaos.

The code refactoring in this commit will make maintaining the code
easier and should make it easier to extend as well.  Further changes and
refactorings may still be needed but they will easier.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
b4a410215e add (*Pod).CreateCommand()
Add a method to Pod to easily access its .config.CreateCommand.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
557a9c1211 generate systemd: rename source files
Rename to `containers{_test}.go` to make some place for the upcoming pod
changes.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
9232d4e443 generate systemd: rephrase lookup error
Rephrase the lookup error when the specified name or ID does not refer
to a container or pod.  Until, only the pod-lookup error has been
returned which can be confusing when actually looking for a container;
a user might have just mistyped the ID or name.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
402c68b41d pod create: add --infra-conmon-pidfile
Add an `--infra-conmon-pidfile` flag to `podman-pod-create` to write the
infra container's conmon process ID to a specified path.  Several
container sub-commands already support `--conmon-pidfile` which is
especially helpful to allow for systemd to access and track the conmon
processes.  This allows for easily tracking the conmon process of a
pod's infra container.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
144c6bb76d generate systemd: rename "cid" to "ctr-id"
Rename the container ID file from "cid" to "ctr-id" to make the
generated unit files a) easier to read and to b) pro-actively
avoid any confusion when pod ID files are being added in the
future.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
cf89bb6711 container-{create,run}: add --pod-id-file
Allow containers to join an existing pod via the `--pod-id-file` which
is already supported by a number of `podman-pod` subcommands.  Also add
tests to make sure it's working and to prevent future regressions.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
7d71d24440 podman-pod{rm,start,stop}: support --pod-id-file
Support the `--pod-id-file` flag in the rm, start and stop pod commands.
This completes the already support flag in pod-create and is another
prerequisite for generating generic systemd unit files for pods.

Also add completions, docs and tests.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
7f5aabb083 systemd/generate: remove unused infra container field
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
636881ece5 pod config: add a CreateCommand field
Add a `CreateCommand` field to the pod config which includes the entire
`os.Args` at pod-creation.  Similar to the already existing field in a
container config, we need this information to properly generate generic
systemd unit files for pods.  It's a prerequisite to support the `--new`
flag for pods.

Also add the `CreateCommand` to the pod-inspect data, which can come in
handy for debugging, general inspection and certainly for the tests that
are added along with the other changes.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
7b85d5c6d2 Merge pull request #6561 from CUB-OIT-PE/fix-truncated-logs
Fixed bug where 'podman log <container>' would truncate some lines.
2020-06-11 04:45:52 -04:00
86ffa552d2 Fixed bug where 'podman log <container>' would truncate some lines.
Signed-off-by: Will Haines <william.haines@colorado.edu>
2020-06-10 15:08:48 -06:00
4e2a0b5b9c Enable IPv6 port binding
Two areas needed tweaking to accomplish this: port parsing and
binding ports on the host.

Parsing is an obvious problem - we have to accomodate an IPv6
address enclosed by [] as well as a normal IPv4 address. It was
slightly complicated by the fact that we previously just counted
the number of colons in the whole port definition (a thousand
curses on whoever in the IPv6 standard body decided to reuse
colons for address separators), but did not end up being that
bad.

Libpod also (optionally) binds ports on the host to prevent their
reuse by host processes. This code was IPv4 only for TCP, and
bound to both for UDP (which I'm fairly certain is not correct,
and has been adjusted). This just needed protocols adjusted to
read "tcp4"/"tcp6" and "udp4"/"udp6" based on what we wanted to
bind to.

Fixes #5715

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-10 13:28:09 -04:00
b2200dbe05 Merge pull request #6550 from giuseppe/fix-userns-in-pod
container: fix creating a userns inside of a pod
2020-06-10 13:22:33 -04:00
c44992827d Merge pull request #6530 from edsantiago/test_podman_remote
Enable, then partially disable, podman-remote testing
2020-06-10 13:19:44 -04:00
6c5bd15264 Merge pull request #6552 from mheon/bump-2.0.0-rc5
Bump to v2.0.0-RC5
2020-06-10 11:20:24 -04:00
cf39c18bed Bump to v2.0.0-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-06-10 09:43:18 -04:00
4c729407e9 Bump to v2.0.0-rc5
Signed-off-by: Matthew Heon <mheon@redhat.com>
v2.0.0-rc5
2020-06-10 09:43:15 -04:00
37c907868d Merge pull request #6537 from vrothberg/events-docs
podman-events: clarify streaming behaviour
2020-06-10 09:32:56 -04:00
6c27e27b8c container: do not set hostname when joining uts
do not set the hostname when joining an UTS namespace, as it could be
owned by a different userns.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-10 14:52:10 +02:00
a389eab8d1 container: make resolv.conf and hosts accessible in userns
when running in a new userns, make sure the resolv.conf and hosts
files bind mounted from another container are accessible to root in
the userns.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-10 14:46:48 +02:00
63468464e8 Merge pull request #6546 from rhatdan/lint
Turn on golint
2020-06-10 08:42:16 -04:00
87718c4e67 Fix Id->ID where possible for lint
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-10 05:49:41 -04:00
4bb43b898d Fixup issues found by golint
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-10 05:49:41 -04:00
99cbe59917 podman-events: clarify streaming behaviour
Unless `--since` or `--until` is specified, `podman events` will stream
new events.  Clarify this behavior in the `--help` message and man page
to avoid confusion.

Fixes: #6536
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-10 11:09:12 +02:00
9967f28339 Merge pull request #6193 from cevich/conmon_ci_packages
Cirrus: Include packages for containers/conmon CI
2020-06-09 21:22:17 -04:00
2fa7f03a35 Merge pull request #6542 from mheon/fix_pod_kill_signalerr
Ensure signal validation happens first in pod kill
2020-06-09 21:16:12 -04:00
455a94d1f9 Cirrus: Include packages for containers/conmon CI
This allows the containers/conmon repository to share the same VM
images produced by containers/libpod.  Included are several packages
which are downloaded only since they might otherwise interfere with
testing for some repos.  This allows stable versions to be at the ready
at testing runtime, avoiding any version updates surprising developers.

Also, re-enable running the VM-image check test which was not working
due to a logic problem in Cirrus-CI configuration.  Update the neglected
tests so that they pass on all distros.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-06-09 14:47:23 -04:00
15f273b931 WIP: Enable (and disable) remote testing
podman-remote has not been tested. A principal part of the
problem was #5387 - the YAML I wrote did not have the
intended effect, it did not set TEST_REMOTE_CLIENT=true
and because of my multiple iterations I did not catch this
during testing.

Part 1 of this PR is to fix .cirrus.yml to enable remote tests.

Part 2 -- what I had first noticed and tried to fix -- is that
rootless_test.sh was never running remote because, of course,
envariables are not sent via ssh. I reworked integration_test.sh
and rootless_test.sh to use a command-line decision instead.

Part 3, sigh, is to disable one failing integration test
and *all* system tests, because so many of the latter are
failing. Addressing those failures needs to be done in
subsequent PRs. Issues #6538, #6539, #6540 are filed for
some of the problems I isolated. There will be more.

Also, minor, fixed some stale references to varlink.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-06-09 12:43:58 -06:00
817dbdfdf8 Ensure signal validation happens first in pod kill
This fixes an error in the system tests, which expect that when
you try and kill a nonexistent pod with an incorrect signal, you
receive an error about the signal, not the pod.

At the same time, fix a missing return statement in the bindings,
which could also have caused us grief.

Fixes #6540

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-09 14:10:10 -04:00
3218736cff fix api fails with 'strconv.ParseUint: parsing "tcp": invalid syntax'
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-06-10 00:03:04 +08:00
fbe09d78e9 Merge pull request #6533 from containers/dependabot/go_modules/github.com/json-iterator/go-1.1.10
Bump github.com/json-iterator/go from 1.1.9 to 1.1.10
2020-06-09 17:47:47 +02:00
607cfa3ffb Merge pull request #6534 from containers/dependabot/go_modules/github.com/containers/common-0.13.0
Bump github.com/containers/common from 0.12.0 to 0.13.0
2020-06-09 17:44:52 +02:00
c831ae110e Merge pull request #6521 from cevich/update_cors_docs
[CI:DOCS] Improve swagger+CORS metadata docs
2020-06-09 16:43:32 +02:00
a2e0e170f9 Merge pull request #6532 from sujil02/python-test
Modify py test to start stop system service for each test
2020-06-09 16:27:24 +02:00
2df9edbd4f Bump github.com/json-iterator/go from 1.1.9 to 1.1.10
Bumps [github.com/json-iterator/go](https://github.com/json-iterator/go) from 1.1.9 to 1.1.10.
- [Release notes](https://github.com/json-iterator/go/releases)
- [Commits](https://github.com/json-iterator/go/compare/v1.1.9...v1.1.10)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-09 10:24:03 -04:00
01c45698ca Bump github.com/containers/common from 0.12.0 to 0.13.0
Bumps [github.com/containers/common](https://github.com/containers/common) from 0.12.0 to 0.13.0.
- [Release notes](https://github.com/containers/common/releases)
- [Commits](https://github.com/containers/common/compare/v0.12.0...v0.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-09 10:23:06 -04:00
4314336ce3 Improve swagger+CORS metadata docs
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-06-09 09:53:19 -04:00
79f30af384 Merge pull request #6520 from mheon/no_conmon_no_error
Ensure Conmon is alive before waiting for exit file
2020-06-09 10:09:14 +02:00
a85e979529 Merge pull request #6513 from containers/dependabot/go_modules/github.com/stretchr/testify-1.6.1
Bump github.com/stretchr/testify from 1.6.0 to 1.6.1
2020-06-08 23:27:47 +02:00