82 Commits

Author SHA1 Message Date
e66346c7b0 Stop wrapping pull messages
The length and size of our error messages on failure to pull
is huge.  This patch at least eliminates some of the wrapping.
But I think eventually we need to look at containers/image
and see if we can modify the error messages to something a little
more human friendly.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-23 05:31:36 -04:00
09dc701097 podman rmi: refactor logic
While this commit was initially meant to fix #5847, it has turned into a
bigger refactoring which I did not manage to break into smaller pieces:

 * Fix #5847 by refactoring the image-removal logic.

 * Make the api handler for image-removal use the ABI code. This way,
   both (i.e., ABI and Tunnel) end up using the same code.  Achieving
   this code share required to move some code around to prevent circular
   dependencies.

 * Everything in pkg/api (excluding pkg/api/types) must now only be
   accessed from code using `ABISupport`.

 * Avoid imports from entities on handlers to prevent circular
   dependencies.

 * Move `podman system service` logic into `cmd` to prevent circular
   dependencies - it depends on pkg/api.

 * Also remove the build header from infra/abi files.  It will otherwise
   confuse swagger and other tools; errors we cannot fix as go doesn't
   expose a build-tag env variable.

Fixes: #5847
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-21 08:12:25 +02:00
37f3b191d5 Add pod prune for api v2.
Add the ability to prune pods for api v2,
Includes the addition of force flag, for client side prompt.
Update test suite to support this use case.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-04-17 17:30:58 -04:00
44a8cf8676 Fixes for system tests
Various fixes to protect against regressions in system tests

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-17 13:22:06 -05:00
5def211400 Merge pull request #5842 from baude/v2bloat2
podman v2 remove bloat v2
2020-04-16 10:52:58 -07:00
ba430bfe5e podman v2 remove bloat v2
rid ourseleves of libpod references in v2 client

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-16 12:04:46 -05:00
e154249b46 allow filters to work when listing containers
enable filters when listing containers on the libpod endpoint.

Fixes: #5841

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-16 09:21:44 -05:00
30d2964ff8 v2 bloat pruning phase 2
this is second phase of removing unneeded bloat in the remote client. this is important to be able to reduce the client size as well as possible native compilation for windows/mac.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-15 16:09:27 -05:00
7147187942 v2specgen prune libpod
use libpod only in the specgen/generate package so that the remote clients do not inherit libpod bloat.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-14 20:02:20 -05:00
85c352d8bc Merge pull request #5709 from vrothberg/v2-search
podmanV2: implement search
2020-04-14 14:51:39 +02:00
d8d1aa49d2 v2podman add container init
add the ability to init a container both local and remote

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-13 19:51:20 -05:00
ff52b7524a podmanV2: implement search
Also implement a new libpod endpoint to add more parameters and to
prevent us from converting between slices and maps and make use of
the filter parsing in the image backend.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-09 13:05:19 +02:00
843fa25890 Merge pull request #5716 from baude/v2ps
podmanv2 ps
2020-04-06 22:04:16 +02: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
b22254dc8b podmanv2 ps
add the ability to list containers

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-06 12:12:59 -05:00
ba64186750 Merge pull request #5689 from sujil02/v2-pod-inspect
podmanv2 pod inspect
2020-04-06 15:23:19 +02:00
6514a5c80e v2podman container create
create a container in podmanv2 using specgen approach.  this is the core implementation and still has quite a bit of code commented out specifically around volumes, devices, and namespaces.  need contributions from smes on these parts.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-03 15:43:03 -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
0433081983 podmanv2 import
add the ability to import a container image from a container export

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-01 15:56:26 -05:00
8500ce6b9a podmanv2 load
enable podman load for v2

add reexec into main

add systemd build flag to v2 makefile

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-01 14:10:57 -05:00
7cbc09971a podmanv2 pod inspect
Add the ability to inspect pod in podmanv2

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-04-01 15:10:49 -04: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
6e8f6cab60 Merge pull request #5675 from vrothberg/v2-pull
podmanV2: implement pull
2020-03-31 21:12:49 +02:00
3bdad6fa2a podmanV2: implement pull
Implement pulling images for the v2 client.  What I _really_ don't like
is the fact that we are now having a near identical code clone among
`pkg/domain/infra/abi` and `pkg/api/handlers/libpod`.  Partly because we
don't yet have a higher-level pull function and partly because we have
redudancy among `pkg/domain` and `pkg/api`.  Pull might be a high
outlier but I am concerned already by the potential of introducing more
redundancy.  I'd love to `infra/abi` and `pkg/abi` to really use the
same code in the future.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-31 13:01:27 +02: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
4352d58549 Add support for containers.conf
vendor in c/common config pkg for containers.conf

Signed-off-by: Qi Wang qiwan@redhat.com
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-27 14:36:03 -04:00
2c5c198020 Merge pull request #5632 from jwhonce/wip/images
V2 podman image prune
2020-03-27 18:47:51 +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
581dd312af V2 podman image prune
* Fixed header for `podman image ls`
* Implemented prune `all` flag, preserved filter method for backwards
  capability
* Updated binding tests

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-26 18:32:44 -07: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
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
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
87293028e6 podmanv2 container exists|wait
enable container exists and wait for podmanv2

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-20 12:54:45 -05:00
1be6178915 Merge pull request #5445 from sujil02/podFilter-new
Filter pods through pod list api
2020-03-19 15:50:50 +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
15326f051d Filter pods through pod list api
Refactored current filter pods flow through the shared pod functions
so filter pod functionalities can be shared between api and cmd.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-03-17 17:46:20 -04: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
846ed00684 Update start stop api to use pod status function.
Update the strat and stop api to validate pod status based on status functions
rather than iterating over all the containers in the pod. (Addressing the TO-DO)

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-03-10 14:37:47 -04: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
ac354ac94a Fix spelling mistakes in code found by codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-07 10:30:44 -05: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