8011 Commits

Author SHA1 Message Date
9fe49335e0 Merge pull request #6249 from jwhonce/wip/resize
V2 Implement terminal handling in bindings attach
2020-05-18 21:58:23 +02:00
1332c8b3ab Merge pull request #6188 from neVERberleRfellerER/autoupdate-systemd-envvar
Give `auto-update` ability to use per-container authfile specified by label.
2020-05-18 21:39:34 +02:00
50ceb261ef Merge pull request #6268 from baude/varlinkbuild2
Fix EOM for SendFile
2020-05-18 21:17:00 +02:00
d6d45003c9 Merge pull request #6232 from edsantiago/bats_cgroupsv1_fixes
system tests: small fixes for rawhide+cgroups v1
2020-05-18 20:37:20 +02:00
6287a55852 V2 Implement terminal handling in bindings attach
* Add support for /exec/{id}/resize
* Add support for ErrSessionNotFound
* Resize container TTY as stdin changes size
* Refactor all resize functions into one handler

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-18 11:21:06 -07:00
6f224d0886 Fix EOM for SendFile
To terminate a connection of varlink, say after sending a file, we need to send a message containing a delimiter of ':' so the client knows to hang up.

Fixes: #6237

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-18 12:45:00 -05:00
8ce7bd569f Bump to v2.0.0-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-18 13:24:12 -04:00
74777ec052 Bump to v2.0.0-rc1
Signed-off-by: Matthew Heon <mheon@redhat.com>
v2.0.0-rc1
2020-05-18 13:24:09 -04:00
d4587c6074 Merge pull request #6264 from baude/v2rmi
v2endpoint remove image path correction
2020-05-18 17:34:38 +02:00
fe16f8f67a v2endpoint remove image path correction
the endpoint for single image removal (on the libpod side) should be as follows:

versionedPath/libpod/images/IMAGENAME

The DELETE method then signifies the removal of the image.

Fixes: #6261

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-18 09:35:51 -05:00
bfcec3203e Merge pull request #6231 from mheon/fix_coverity
Fix two coverity issues (unchecked null return)
2020-05-17 04:03:54 -07:00
9177c89edd Give auto-update ability to use per-container authfile specified by label.
Signed-off-by: Ondřej Kraus <neverberlerfellerer@gmail.com>
2020-05-17 11:37:12 +02:00
343ab99b39 Merge pull request #5831 from mheon/exec_http_attach
APIv2 ExecStart (Attached Only)
2020-05-15 13:19:43 -07:00
6d1e5c713a Drop APIv2 resize endpoint
Jhon is working on an alternative version that will combine
container and exec session resize, so we'll wait for that.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-15 15:02:41 -04:00
ab25f70dad Drop a debug line which could print very large messages
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-15 14:35:10 -04:00
c61a45caf8 Merge pull request #6230 from rhatdan/makefile
Fix REMOTETAGS
2020-05-15 10:47:18 -07:00
59dd3418f6 Merge pull request #6246 from baude/v2remoterun
v2 podman remote attach, start, and run
2020-05-15 09:59:18 -07:00
e601101e7d Merge pull request #6201 from cevich/update_ubuntu20
Cirrus: Update Ubuntu 18 to 20
2020-05-15 09:53:54 -07:00
ce56202b45 v2 podman remote attach, start, and run
for the remote client, add the ability to attach to a container, start a container, and run a container.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-15 10:09:45 -05:00
d5358e6764 Merge pull request #6215 from maxm123/master
Use the containers.conf cni_config_dir option for inspect and delete
2020-05-15 07:39:35 -07:00
a88cd9a22e Merge pull request #6227 from adrianreber/typo
Fix checkpoint --leave-running
2020-05-15 06:23:32 -07:00
4611ff5ce4 Merge pull request #6236 from jwhonce/wip/boxed
Make convenience boxed true/false easier to use
2020-05-14 15:13:47 -07:00
79ad6bb53d Fix lint
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-14 17:34:42 -04:00
50ed292aee Remove duplicated exec handling code
During the initial workup of HTTP exec, I duplicated most of the
existing exec handling code so I could work on it without
breaking normal exec (and compare what I was doing to the nroaml
version). Now that it's done and working, we can switch over to
the refactored version and ditch the original, removing a lot of
duplicated code.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-14 17:32:44 -04:00
a6d9cf9a5e Fix lint
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-14 17:01:49 -04:00
1641f4fc0d Update API documentation for Inspect
Most importantly, note the pruning behavior of compat Inspect.

Less importantly, note that the Tty parameter to Start is only
ignored, as opposed to being not supported.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-14 17:00:19 -04:00
08d04c2e05 Parameters for ExecStart are body, not query
Oops. Misread the docs when I initially implemented this. Nice
and easy fix, at least.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-14 16:56:02 -04:00
0f0abe2909 Prune stale exec sessions on inspect
The usual flow for exec is going to be:
- Create exec session
- Start and attach to exec session
- Exec session exits, attach session terminates
- Client does an exec inspect to pick up exit code

The safest point to remove the exec session, without doing any
database changes to track stale sessions, is to remove during the
last part of this - the single inspect after the exec session
exits.

This is definitely different from Docker (which would retain the
exec session for up to 10 minutes after it exits, where we will
immediately discard) but should be close enough to be not
noticeable in regular usage.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-14 16:56:02 -04:00
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