98 Commits

Author SHA1 Message Date
e0847f5457 V2 podman system service
* Added support for system service
* Enabled linting on the varlinkapi source, needed to support V2
  service command
* Added support for PODMAN_SOCKET

Skip linting deprecated code

Rather than introduce bugs by correcting deprecated code, linting the
code is being skipped. Code that is being ported into V2 is being
checked.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-07 19:22:10 -07:00
8ae28a55ac V2 podman diff(changes) support
* Ported CLI command
* Added API endpoint
* Added bindings
* Updated swagger (TODO: n endpoints, one handler)

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-07 09:39:46 -07:00
e20ecc733c refactor info
the current implementation of info, while typed, is very loosely done so.  we need stronger types for our apiv2 implmentation and bindings.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-06 12:45:42 -05:00
35f5867833 Merge pull request #5672 from baude/v2save
podmanv2 save image
2020-04-03 22:41:18 +02:00
837aad724f podmanv2 save image
add ability to save an image for podman v2

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-03 13:07:35 -05:00
64cade0f71 Merge pull request #5638 from baude/v2containercheck
podmanv2 checkpoint and restore
2020-04-03 20:05:30 +02:00
8a16674722 podmanv2 checkpoint and restore
add the ability to checkpoint and restore containers on v2podman

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-03 09:32:06 -05:00
44a515015c podmanV2: implement push
* Implement `podman-push` and `podman-image-push` for the podmanV2
  client.

* Tests for `pkg/bindings` are not possible at the time of writing as we
  don't have a local registry running.

* Implement `/images/{name}/push` compat endpoint. Tests are not
  implemented for this v2 endpoint.  It has been tested manually.

General note: The auth config extraction from the http header is not
implement for push.  Since it's not yet supported for other endpoints
either, I deferred it to future work.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-02 17:01:32 +02:00
bb39051616 podmanv2 export
add ability to export a container to a tarball

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-01 16:02:53 -05:00
26644d7cb8 podman v2 image tag and untag
add the ability to tag and untag images in podmanv2

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-31 19:36:26 -05:00
11e79bcd95 fix more swagger inconsistencies
I'm getting really tired of doing this manually.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-30 09:45:34 -06:00
edec8ccf3f swagger: top: remove "Docker" from the identifiers
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-28 17:32:27 +01:00
cc129d13c5 v2 api: implement pods top endpoint
Note that this commit does not add tests for the pod-top endpoint.
They will be added in a later change.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-28 16:49:08 +01:00
e56d529561 podmanv2 pod create using podspecgen
using the factory approach similar to container, we now create pods based on a pod spec generator.  wired up the podmanv2 pod create command, podcreatewithspec binding, simple binding test, and apiv2 endpoint.

also included some code refactoring as it introduced as easy circular import.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-27 09:04:10 -05:00
2fa78938a9 podmanv2 container inspect
add ability to inspect a container

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-26 15:54:26 -05:00
c5ce210f7d podmanv2 pod subcommands
add pod kill, pause, restart, rm, start, stop, and unpause

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-26 14:14:05 -05:00
913426c70c Merge pull request #5573 from mheon/add_basic_exec_endpoints
Implement APIv2 Exec Create and Inspect Endpoints
2020-03-26 20:10:08 +01:00
69b011d3ac Merge pull request #5604 from jwhonce/wip/images
V2 podman images/image list
2020-03-25 01:26:21 +01:00
1d7cb7cc48 V2 podman images/image list
* Updated entities to support flags/options
* Updated bindings caused by entities changes
* Removed handlers.ImageSummary in favor of entities.ImageSummary

* Introduced StringSet() container object to simply error checking

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-24 16:06:01 -07:00
ae614920bf podmanv2 volumes
add volume commands: create, inspect, ls, prune, and rm

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-24 16:03:49 -05:00
eb36f54717 Correctly document libpod commit endpoint
In #5588 it was forgotten and documentation still points to `/commit`.

Signed-off-by: Matej Marusak <mmarusak@redhat.com>
2020-03-24 08:37:54 +01:00
0c40b62c77 Implement APIv2 Exec Create and Inspect Endpoints
Start and Resize require further implementation work.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-03-23 16:20:42 -04:00
12e78155e1 apiv2 container commit for libpod
add an endpoint for a libpod specific commit.  add the abilility to define the format.  also update documentation accordingly.

Fixes: #5586

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-23 14:14:17 -05:00
c3a9ff1174 podmanv2 volume create
add volume create

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-20 18:27:08 -05:00
d1c26af144 apiv2 add bindings for logs|events
add go-bindings for logs and events. tests were also added.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-19 09:38:00 -05:00
464a1cd485 Merge pull request #5540 from jwhonce/issues/5531
Reduce CPU usage when --timeout=0
2020-03-18 21:55:09 +01:00
d66d542820 Merge pull request #5544 from baude/apiv2serveswagger
serve swagger when present
2020-03-18 21:26:52 +01:00
52c8350530 serve swagger when present
register the swagger endpoint and add some error handling for when the swagger file does not exist

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-18 14:34:14 -05:00
f557cf91d2 swagger: more consistency fixes
Some new 'manifests' entries have the wrong {name} parameter

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-18 13:33:07 -06:00
651ddd3560 Reduce CPU usage when --timeout=0
* Add second go routine for when a Timer is not needed.
* goimports updated some project files

Fixes #5531

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-18 10:27:25 -07:00
9ef5d28759 Merge pull request #5449 from baude/manifests
apiv2 addition of manifests
2020-03-17 16:00:05 +01:00
abbbeacd68 apiv2 addition of manifests
add endpoints for create, add, remove, inspect, and push.  this allows manifests to be managed through the restful interfaces.

also added go-bindings and tests

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-16 10:03:55 -05:00
2099643aa2 add apiv2 healthcheck code
reworking binding and endpoint to actually work.  added documentation in swagger for and various return code possibilities.  add a good start on tests though we need some other container functions not yet implemented for that.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-13 07:43:12 -05:00
216a6091d0 [CI:DOCS]Add libpod event endpoint
add an endpoint for events on the libpod side of the house.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-11 09:25:57 -05:00
a83a94b095 Merge pull request #5448 from vrothberg/update-systemd
update systemd & dbus dependencies
2020-03-10 19:31:14 +01:00
450361fc64 update systemd & dbus dependencies
Update the outdated systemd and dbus dependencies which are now provided
as go modules.  This will further tighten our dependencies and releases
and pave the way for the upcoming auto-update feature.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-10 18:34:55 +01:00
31112e4b08 Refactor handler packages
To help with packaging, the handlers in pkg/api/handlers are now found
in pkg/api/handler/compat.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-10 08:03:41 -07:00
c8de26fb08 Merge pull request #5374 from baude/create
add default network for apiv2 create
2020-03-07 14:16:43 +01:00
8b5e2a6297 add default network for apiv2 create
during container creation, if no network is provided, we need to add a default value so the container can be later started.

use apiv2 container creation for RunTopContainer instead of an exec to the system podman. RunTopContainer now also returns the container id and an error.

added a libpod commit endpoint.

also, changed the use of the connections and bindings slightly to make it more convenient to write tests.

Fixes: 5366
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-06 14:31:45 -06:00
89b083f8b4 Register handlers without version to align with docker API
Signed-off-by: Steve Taylor <steven@taylormuff.co.uk>
2020-03-05 22:28:22 +00:00
1641ee6180 Merge pull request #5371 from edsantiago/apiv2_fixes
more swagger fixes
2020-03-02 23:52:28 +01:00
c3c334a323 more swagger fixes
Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-02 12:01:56 -07:00
0904873100 rework apiv2 wait endpoint|binding
added the ability to wait on a condition (stopped, running, paused...) for a container.  if a condition is not provided, wait will default to the stopped condition which uses the original wait code paths.  if the condition is stopped, the container exit code will be returned.

also, correct a mux issue we discovered.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-28 09:36:53 -06:00
306b44380f binding tests for volumes
add binding tests for volumes: inspect(get), create, remove, prune, and list

implement filters ability for volumes

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-27 13:11:42 -06:00
997e3c8863 Remove 1 sec delay
* Stop closing net.Listener() twice on interrupt
 * Do not report error if closing server twice

Fixes #5311

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-02-25 11:04:20 -07:00
a554e97adc Merge pull request #5236 from marusak/filter_by_id
apiv2: Image filtering and fixup docs
2020-02-21 12:17:38 -05:00
63a2fec6cb Swagger: yet more fixes
PR #5204 added /libpod/containers/create but with the wrong
swagger comment. Fix that.

Also fix some other inconsistencies: missing 'libpod' prefix,
missing 'Container' suffix, and change 'ContainerCreate'
to 'CreateContainer'; all of these changes preserve consistency
with both the invoked function as well as the overall naming
conventions used in this module.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-02-20 12:21:52 -07:00
1d8437d3ca Swagger: fix one incorrect comment
PR #5235 updated a bunch of entrypoints from {name} to {name:.*},
requiring matching changes to swagger comments. Looks like one
got missed due to the manual nature of this work.

Have I mentioned lately that manual maintenance of duplicate
information is not a great idea?

Discrepancy caught by my script, which I would really like to
look into getting into CI, but is gating on #5238. (I would
actually not like to get this script into CI, I would prefer
to have the duplicate information be autogenerated from
the function calls themselves, but I seem to have lost
that battle)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-02-19 16:21:11 -07:00
d65ff6b3ec apiv2 container create using specgen
this uses the specgen structure to create containers rather than the outdated createconfig.  right now, only the apiv2 create is wired up.  eventually the cli will also have to be done.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-19 15:20:15 -06:00
2a411bcbfa Swagger: fix inconsistencies (try #2)
As I've mentioned once or twice, hand-maintained swagger docs
are evil. This commit attempts to fix:

  * Inconsistent methods (swagger says POST but code signature
    says GET)

  * Inconsistent capitalization

  * Typos ("Mounter", "pood")

  * Completely wrong paths (/inspect vs /json)

  * Missing .Method() registrations

  * Missing /libpod in some /volumes paths

  * Incorrect method declaration: /libpod/containers/.../kill
    was correct (POST) in swagger but wrong in the code itself
    (http.MethodGet). Correct the latter to MethodPost

This is two hours' work, even with a script I have that
tries to cross-check everything.

Swagger docs should not be human-maintained.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-02-18 11:07:07 -07:00