7982 Commits

Author SHA1 Message Date
0c3bed119b Remove exec sessions on container restart
With APIv2, we cannot guarantee that exec sessions will be
removed cleanly on exit (Docker does not include an API for
removing exec sessions, instead using a timer-based reaper which
we cannot easily replicate). This is part 1 of a 2-part approach
to providing a solution to this. This ensures that exec sessions
will be reaped, at the very least, on container restart, which
takes care of any that were not properly removed during the run
of a container.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-14 16:56:02 -04:00
2b08359faf Fix start order for APIv2 exec start endpoint
This makes the endpoint (mostly) functional.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-14 16:56:02 -04:00
c76cf1735c Don't fail when saving exec status fails on removed ctr
We can't save the exec session, but it's because the container
is entirely gone, so no point erroring.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-14 16:56:01 -04:00
cf1f13af98 Add APIv2 handler for resizing exec sessions
Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-14 16:56:01 -04:00
4d410b7cb7 Ensure that Streams are set to defaults for HTTP attach
If not overridden, we should use the attach configuration given
when the exec session was first created.

Also, setting streams should not conflict with a TTY - the two
are allowed together with Attach and should be allowed together
here.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-14 16:56:01 -04:00
ce56b68871 Wire in endpoint for ExecStart
This is still very early not not well tested, and missing resize
capability, but it does provide the first bits of exec.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-14 16:56:01 -04:00
50cc56bc4a Add an initial implementation of HTTP-forwarded exec
This is heavily based off the existing exec implementation, but
does not presently share code with it, to try and ensure we don't
break anything.

Still to do:
- Add code sharing with existing exec implementation
- Wire in the frontend (exec HTTP endpoint)
- Move all exec-related code in oci_conmon_linux.go into a new
  file
- Investigate code sharing between HTTP attach and HTTP exec.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-14 16:51:57 -04:00
f587fa3ba3 Make convenience boxed true/false easier to use
* changed PFalse to &false
* changed PTrue to &true

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-14 13:35:59 -07:00
48d83482db Use the libpod.conf cni_config_dir option for inspect and delete
The pkg/network/files.go methods currently use the constant '/etc/cni/net.d'
for network handling. This results in the unability of podman-network-inspect
and podman-network-rm to locate the cni network configuration files.
This commit propagates the libpod.Runtime through the networking methods and
finally makes use of its configuration (config.Network.NetworkConfigDir).
Closes #6212

Signed-off-by: Maximilian Müller <maxm123@techie.com>
2020-05-14 22:15:32 +02:00
0d9625152b Merge pull request #6229 from mheon/small_kata_fix
Cleanup OCI runtime before storage
2020-05-14 12:51:39 -07:00
32268eaa62 Merge pull request #6235 from QiWang19/events-format
fix bug --format {{json.}} of events
2020-05-14 12:33:11 -07:00
b2d0ccdc22 Cirrus: Refresh VM Images, Add Ubuntu 20 LTS
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-05-14 15:00:34 -04:00
8d54e4855c Cirrus: Fix image-name hints
This properly prints out image-name hints when executing the hack script
without any arguments.  It is required due to changes made by Ed for
test-name beatification.  An identical change was made and reviewed by
Ed in the containers/storage repo.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-05-14 15:00:34 -04:00
6479b54f41 Cirrus: Update Ubuntu 18 to 20
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-05-14 15:00:34 -04:00
77dbfc7530 Merge pull request #6220 from jwhonce/wip/attach
V2 Update attach bindings to use Readers/Writers vs chan
2020-05-14 11:41:09 -07:00
28ffe74e44 fix bug --format {{json.}} of events
Allow the `podman events --format` accept {{json.}} and complete small fix podman-events.1.md

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-14 14:28:51 -04:00
d34e5a142a V2 Update attach bindings to use Readers/Writers vs chan
* Change function call to use readers/writers in place channels
* Support stdin for pushing data from client to container
* Add bindings test

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-14 10:53:46 -07:00
892d81685c Ensure that cleanup runs before we set Removing state
Cleaning up the OCI runtime is not allowed in the Removing state.
To ensure it is actually cleaned up, when calling cleanup() as
part of removing a container, do so before we set the Removing
state, so we can successfully remove.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-14 11:58:02 -04:00
cd85ba196d system tests: small fixes for rawhide+cgroups v1
Three small fixes for breaking tests on rawhide:

  1) run test: looks like runc changed the format of
     an error message, adding a colon in one place.
     runc is used on rawhide when booted in cgroups v1

  2) volumes test: difference in exit status and error
     message between runc and crun.

  3) systemd test: define XDG_RUNTIME_DIR if unset.
     podman helpfully sets this to a reasonable default,
     but the 'systemctl' commands used in this test do not.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-05-14 09:55:25 -06:00
5694aba9e3 Fix two coverity issues (unchecked null return)
Theoretically these should never happen, but it never hurts to be
sure and check. Add a check to one, make the other one a
create-if-not-exist (it was just adding, not checking the
contents).

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-14 11:17:34 -04:00
7e9ed37c09 Merge pull request #6228 from rhatdan/spec
Default podman.spec to use crun
2020-05-14 07:18:41 -07:00
46b13d4d61 Fix REMOTETAGS
Handle REMOTETAGS the same way for all remote commands.

This fixes issues where remote commands are not building correctly on rhel7 and centos7 systems.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-14 09:53:40 -04:00
83a1e2e5d2 Cleanup OCI runtime before storage
Some runtimes (e.g. Kata containers) seem to object to having us
unmount storage before the container is removed from the runtime.
This is an easy fix (change the order of operations in cleanup)
and seems to make more sense than the way we were doing things.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-14 09:39:41 -04:00
837b80bc07 Default podman.spec to use crun
On systems with cgroupV2 runc will not currently work
switch the default in spec file to use crun.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-14 09:38:29 -04:00
e35edb6cc5 Merge pull request #6223 from containers/dependabot/go_modules/github.com/containernetworking/plugins-0.8.6
Bump github.com/containernetworking/plugins from 0.8.5 to 0.8.6
2020-05-14 06:35:38 -07:00
7c7f4dbb51 Fix checkpoint --leave-running
There was typo in the variable name and in one place it was not
correctly passed to the next layer.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-05-14 14:29:04 +02:00
f2f0de430d Merge pull request #6204 from containers/dependabot/go_modules/github.com/containers/storage-1.19.2
Bump github.com/containers/storage from 1.19.1 to 1.19.2
2020-05-14 05:17:38 -07:00
1f0cc866d4 Bump github.com/containers/storage from 1.19.1 to 1.19.2
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.19.1 to 1.19.2.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.19.1...v1.19.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-14 07:23:58 -04:00
9f0845ca43 Bump github.com/containernetworking/plugins from 0.8.5 to 0.8.6
Bumps [github.com/containernetworking/plugins](https://github.com/containernetworking/plugins) from 0.8.5 to 0.8.6.
- [Release notes](https://github.com/containernetworking/plugins/releases)
- [Commits](https://github.com/containernetworking/plugins/compare/v0.8.5...v0.8.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-14 07:22:48 -04:00
150679d7b1 Merge pull request #6218 from mheon/master_bump_releasenotes
[CI:DOCS] Update release notes and version on master
2020-05-14 01:45:32 -07:00
fa5b33e70b Merge pull request #6211 from baude/v2remoteimagetree
enable remote image tree
2020-05-13 13:38:47 -07:00
5e245b02e9 Merge pull request #6206 from containers/dependabot/go_modules/github.com/containers/conmon-2.0.16incompatible
Bump github.com/containers/conmon from 2.0.14+incompatible to 2.0.16+incompatible
2020-05-13 13:31:03 -07:00
38a772e82c Update release notes and version on master
We released v1.9.2 on the v1.9 branch, so bring the release notes
and readme up to date.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-13 15:58:25 -04:00
3c58e4fc76 Merge pull request #6214 from baude/v2removelibconf
[CI:DOCS]remove libpod.conf from spec
2020-05-13 12:32:52 -07:00
71f66f03c5 Merge pull request #6203 from jwhonce/wip/attach
V2 attach bindings and test
2020-05-13 12:30:14 -07:00
886b2cc4b1 Merge pull request #6197 from baude/v2remotenetwork
enable podman v2 networking for remote client
2020-05-13 12:24:05 -07:00
b6113e2b9e WIP V2 attach bindings and test
* Add ErrLostSync to report lost of sync when de-mux'ing stream
* Add logus.SetLevel(logrus.DebugLevel) when `go test -v` given
* Add context to debugging messages

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-13 11:49:17 -07:00
b5ea00b4f7 [CI:DOCS]remove libpod.conf from spec
in the contrib rpm.spec.in, we no longer should try to package libpod.conf

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-13 11:54:34 -05:00
3fea2f0a91 enable remote image tree
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-13 09:41:39 -05:00
c5f9e7f522 Bump github.com/containers/conmon
Bumps [github.com/containers/conmon](https://github.com/containers/conmon) from 2.0.14+incompatible to 2.0.16+incompatible.
- [Release notes](https://github.com/containers/conmon/releases)
- [Changelog](https://github.com/containers/conmon/blob/master/changelog.txt)
- [Commits](https://github.com/containers/conmon/compare/v2.0.14...v2.0.16)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-13 09:17:15 -04:00
d147b3ee02 Merge pull request #6200 from haircommander/skip-unified
cgroup: skip unified if we are using v1
2020-05-13 03:23:11 -07:00
c46ba9905f Merge pull request #6205 from containers/dependabot/go_modules/gopkg.in/yaml.v2-2.3.0
Bump gopkg.in/yaml.v2 from 2.2.8 to 2.3.0
2020-05-13 03:10:22 -07:00
b364420d34 Merge pull request #6202 from edsantiago/bats_volumes
system tests: add volume tests
2020-05-13 02:50:24 -07:00
f736bc9447 Bump gopkg.in/yaml.v2 from 2.2.8 to 2.3.0
Bumps [gopkg.in/yaml.v2](https://github.com/go-yaml/yaml) from 2.2.8 to 2.3.0.
- [Release notes](https://github.com/go-yaml/yaml/releases)
- [Commits](https://github.com/go-yaml/yaml/compare/v2.2.8...v2.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-13 11:28:03 +02:00
3ec335bc9f system tests: add volume tests
Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-05-12 14:43:17 -06:00
486a117331 Merge pull request #6196 from mheon/remote_libpod_conf
Remove libpod.conf from repo
2020-05-12 13:35:15 -07:00
f4b59c74a7 cgroup: skip unified if we are using v1
There exists a chance for a node to be booted in v1, but have reminents of v2. An example is this CRI-O ci run: https://deck-ci.apps.ci.l2s4.p1.openshiftapps.com/view/gcs/origin-federated-results/pr-logs/pull/cri-o_cri-o/3565/test_pull_request_crio_critest_fedora/11243/

We fail because we are incorrectly writing to the unified path, because we are v1. We should not write to the unified path if we are v1

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2020-05-12 15:36:33 -04:00
cf502b99fe enable podman v2 networking for remote client
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-12 13:23:43 -05:00
440e97c2c0 Remove libpod.conf from repo
Now that we're shipping containers.conf, we don't want to provide
a libpod.conf anymore. This removes libpod.conf from the repo and
as many direct uses as I can find.

There are a few more mentions in the documentation, but someone
more familiar with containers.conf should make those edits.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-12 14:15:44 -04:00
5b4e91db73 Merge pull request #6174 from giuseppe/fix-events-rootless
rootless: do not set pids limits with cgroupfs
2020-05-12 10:09:09 -07:00