320 Commits

Author SHA1 Message Date
ab3a620f74 Merge pull request #6398 from rhatdan/32bit
Fix builds on 32 Arches.
2020-05-27 11:18:37 -04:00
f8632bad82 Fix builds on 32 bit arches
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-27 09:52:36 -04:00
d6fd0952f8 v2 libpod push: correct docs
The swagger documentation for the libpod push endpoint were not in sync
with the implementation.  Correct these docs to reflect the parameters
that are actually supported.

Fixes: #6388
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-27 15:26:46 +02:00
5dfddf04ee v2 copy endpoints
add copy endpoint inputs and outputs.  these endpoints are not implemented yet, nor are any bindings.  this allows us to update this later without having to change our api version.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-26 12:04:20 -05:00
0b7b974868 Merge pull request #6238 from baude/v2compatnet
network compatibility endpoints for API
2020-05-25 04:46:47 -04:00
c3af2faab2 network compatibility endpoints for API
add endpoints for networking compatibility with the API.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-22 13:48:52 -05:00
6f5bc712de Add MethodNotAllowedHandler() to add in debugging
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-22 11:48:13 -07:00
f51e0d0597 V2 enable remote logs and testing
* wire up bindings and handler for obtaining logs remotely
* enable debug logging from podman in e2e test using DEBUG and
  DEBUG_SERVICE env variables
* Fix error in streaming log frames
* enable remote logs test

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-22 07:51:29 -07:00
cf5d33807f Merge pull request #6345 from QiWang19/mani-push-test
remote manifest test
2020-05-22 15:47:33 +02:00
a61f9fd547 Removes remote system reset functionality. skip e2e test for remote.
As system reset too dangerous for remote use, deleting the functionality
and the test case.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-05-22 07:49:55 -04:00
f7dd915acc remote manifest test
Enable remove manifest tests. Skip --purge test because remote does not support it.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-21 16:17:39 -04:00
845a795a7a v2 podman-remote build
this is a very basic implementation of build.  some of the more advanced options need to be included still as well.  i think the endpoints for compat and libpod will have to split given buildahs more advanced set of options.  that should probably be done by someone more experienced with build internals.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-21 14:22:11 -05:00
363f8820bc Merge pull request #6312 from rhatdan/image
Fix remote handling of podman images calls
2020-05-21 17:13:36 +02:00
6668b131eb Merge pull request #6304 from baude/v2remotehctests
Fix remote integration for healthchecks
2020-05-21 16:05:47 +02:00
a4c8198afd Fix remote handling of podman images calls
Enable three more tests
Fix handling of image filters

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-21 09:28:42 -04:00
e8e5a5f96e Merge pull request #6305 from baude/v2podcreatetest
enable pod_create remote integration tests
2020-05-20 22:44:12 +02:00
fed4ef09ce enable pod_create remote integration tests
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-20 14:57:30 -05:00
6a75dfa8a8 Merge pull request #6297 from mheon/minor_fix_attach
Print container state when erroring that it is improper
2020-05-20 21:46:55 +02:00
141b34f6be Fix remote integration for healthchecks
the one remaining test that is still skipped do to missing exec function

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-20 14:43:01 -05:00
f9c392f50a V2 API Version Support
* Update blang/semver to allow ParseTolerant() support
* Provide helper functions for API handlers to obtain client's 'version'
  path variable focused on API endpoint tree: libpod vs. compat
* Introduce new errors:
  * version not given in path, endpoints may determine if this is a hard
    error (ErrVersionNotGiven)
  * given version not supported (ErrVersionNotSupported), only a soft
    error if the handler is going to hijack the connection
* Added unit tests for version parsing
* bindings check version on connect:
  * client <= Server API version connection is continued
  * client >= Server API version connection fails

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-20 10:21:30 -07:00
07d82d111a Print container state when erroring that it is improper
This is a nice little convenience - lets people know why we won't
let them attach to a container.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-05-20 13:19:01 -04:00
8675a09e2e [CI:DOCS] Image tree endpoint should return 404
when trying to get an image tree for a missing image, it should return a 404.  doc fix only.

Fixes: #6289

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-20 09:30:20 -05: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
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
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
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
79ad6bb53d Fix lint
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-14 17:34:42 -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
cf1f13af98 Add APIv2 handler for resizing exec sessions
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
fa5b33e70b Merge pull request #6211 from baude/v2remoteimagetree
enable remote image tree
2020-05-13 13:38:47 -07:00
71f66f03c5 Merge pull request #6203 from jwhonce/wip/attach
V2 attach bindings and test
2020-05-13 12:30:14 -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
3fea2f0a91 enable remote image tree
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-13 09:41:39 -05: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
03c29c357f add podman remote system df
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-12 08:35:48 -05:00
1c6ae73a89 Adds tunnel routes for system reset.
Adds tunnel routes for system reset.
Makes forces flag local as options are not propogated down the stack.
Adds relevant test cases and swagger docs.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-05-11 17:03:32 -04:00
931bd5ace6 V2 Impliment tunnelled podman version
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-08 15:57:26 -07:00
f269be3a31 add {generate,play} kube
Add the `podman generate kube` and `podman play kube` command.  The code
has largely been copied from Podman v1 but restructured to not leak the
K8s core API into the (remote) client.

Both commands are added in the same commit to allow for enabling the
tests at the same time.

Move some exports from `cmd/podman/common` to the appropriate places in
the backend to avoid circular dependencies.

Move definitions of label annotations to `libpod/define` and set the
security-opt labels in the frontend to make kube tests pass.

Implement rest endpoints, bindings and the tunnel interface.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-06 17:08:22 +02:00
9db97dbab8 Merge pull request #6080 from baude/v2stats
v2 podman stats
2020-05-05 17:29:56 +02:00
b5a235df90 v2 podman stats
Signed-off-by: baude <bbaude@redhat.com>
2020-05-05 08:46:51 -05:00
7f97896c59 image removal: refactor part 2
Continue the refactoring of image removal.  I didn't manage to break all
the following changes into smaller and easier to digest commits due to
time constraints:

 * Return an error slice instead of a single error. Use multierror only
   in the client/frontend.  Reflect that in the types.

 * Use the batch image removal in the client while preserving the more
   rest-idiomatic single-image removal endpoint.

 * Add a new handler for the single-image removal endpoint to make it
   share the same code as the batch endpoint.

 * Expose bindings for the single and batch endpoints, so we can
   properly test them.

 * Add several convenience functions for error handling to
   pkg/errorhandling.

 * Set the correct error type in libpod to set the exit code to 2 when
   one or more containers are using an image.

 * Massage the bindings tests a bit and tackle compilation errors.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-04 16:01:45 +02:00
4ed125f7b5 Merge pull request #5907 from sujil02/systemprune-v2
Adding system prune for podman v2
2020-04-28 18:11:39 +02:00
f6f7172494 Merge pull request #6000 from mheon/volume_backend_flags
Add support for volumes-from, image volumes, init
2020-04-27 21:53:37 +02:00
ccf009d22e Merge pull request #6001 from baude/v2intload
enable load integration tests
2020-04-27 20:34:39 +02:00
02671a103f Add support for volumes-from, image volumes, init
This should complete Podmanv2's support for volume-related flags.
Most code was sourced from the old pkg/spec implementation with
modifications to account for the split between frontend flags
(volume, mount, tmpfs) and the backend flags implemented here.

Also enables tests for podman run with volumes

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-04-27 13:13:21 -04:00
6db081fc5e enable load integration tests
fix bug where multiple images can be loaded and have to be able to handle the return of multiple names

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-27 10:20:53 -05:00