automation-tests/cmd/podman
Jhon Honce d924494f56 Initial commit on compatible API
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Create service command

Use cd cmd/service && go build .

$ systemd-socket-activate -l 8081 cmd/service/service &
$ curl http://localhost:8081/v1.24/images/json

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Correct Makefile

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Two more stragglers

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Report errors back as http headers

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Split out handlers, updated output

Output aligned to docker structures

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Refactored routing, added more endpoints and types

* Encapsulated all the routing information in the handler_* files.
* Added more serviceapi/types, including podman additions. See Info

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Cleaned up code, implemented info content

* Move Content-Type check into serviceHandler
* Custom 404 handler showing the url, mostly for debugging
* Refactored images: better method names and explicit http codes
* Added content to /info
* Added podman fields to Info struct
* Added Container struct

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Add a bunch of endpoints

containers: stop, pause, unpause, wait, rm
images: tag, rmi, create (pull only)

Signed-off-by: baude <bbaude@redhat.com>

Add even more handlers

* Add serviceapi/Error() to improve error handling
* Better support for API return payloads
* Renamed unimplemented to unsupported these are generic endpoints
  we don't intend to ever support.  Swarm broken out since it uses
  different HTTP codes to signal that the node is not in a swarm.
* Added more types
* API Version broken out so it can be validated in the future

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Refactor to introduce ServiceWriter

Signed-off-by: Jhon Honce <jhonce@redhat.com>

populate pods endpoints

/libpod/pods/..

exists, kill, pause, prune, restart, remove, start, stop, unpause

Signed-off-by: baude <bbaude@redhat.com>

Add components to Version, fix Error body

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Add images pull output, fix swarm routes

* docker-py tests/integration/api_client_test.py pass 100%
* docker-py tests/integration/api_image_test.py pass 4/16
+ Test failures include services podman does not support

Signed-off-by: Jhon Honce <jhonce@redhat.com>

pods endpoint submission 2

add create and others; only top and stats is left.

Signed-off-by: baude <bbaude@redhat.com>

Update pull image to work from empty registry

Signed-off-by: Jhon Honce <jhonce@redhat.com>

pod create and container create

first pass at pod and container create.  the container create does not
quite work yet but it is very close.  pod create needs a partial
rewrite.  also broken off the DELETE (rm/rmi) to specific handler funcs.

Signed-off-by: baude <bbaude@redhat.com>

Add docker-py demos, GET .../containers/json

* Update serviceapi/types to reflect libpod not podman
* Refactored removeImage() to provide non-streaming return

Signed-off-by: Jhon Honce <jhonce@redhat.com>

create container part2

finished minimal config needed for create container.  started demo.py
for upcoming talk

Signed-off-by: baude <bbaude@redhat.com>

Stop server after honoring request

* Remove casting for method calls
* Improve WriteResponse()
* Update Container API type to match docker API

Signed-off-by: Jhon Honce <jhonce@redhat.com>

fix namespace assumptions

cleaned up namespace issues with libpod.

Signed-off-by: baude <bbaude@redhat.com>

wip

Signed-off-by: baude <bbaude@redhat.com>

Add sliding window when shutting down server

* Added a Timeout rather than closing down service on each call
* Added gorilla/schema dependency for Decode'ing query parameters
* Improved error handling
* Container logs returned and multiplexed for stdout and stderr
  * .../containers/{name}/logs?stdout=True&stderr=True
* Container stats
  * .../containers/{name}/stats

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Improve error handling

* Add check for at least one std stream required for /containers/{id}/logs
* Add check for state in /containers/{id}/top
* Fill in more fields for /info
* Fixed error checking in service start code

Signed-off-by: Jhon Honce <jhonce@redhat.com>

get rest  of image tests for pass

Signed-off-by: baude <bbaude@redhat.com>

linting our content

Signed-off-by: baude <bbaude@redhat.com>

more linting

Signed-off-by: baude <bbaude@redhat.com>

more linting

Signed-off-by: baude <bbaude@redhat.com>

pruning

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]apiv2 pods

migrate from using args in the url to using a json struct in body for
pod create.

Signed-off-by: baude <bbaude@redhat.com>

fix handler_images prune

prune's api changed slightly to deal with filters.

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]enabled base container create tests

enabling the base container create tests which allow us to get more into
the stop, kill, etc tests. many new tests now pass.

Signed-off-by: baude <bbaude@redhat.com>

serviceapi errors: append error message to API message

I dearly hope this is not breaking any other tests but debugging
"Internal Server Error" is not helpful to any user.  In case, it
breaks tests, we can rever the commit - that's why it's a small one.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>

serviceAPI: add containers/prune endpoint

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>

add `service` make target

Also remove the non-functional sub-Makefile.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>

add make targets for testing the service

 * `sudo make run-service` for running the service.

 * `DOCKERPY_TEST="tests/integration/api_container_test.py::ListContainersTest" \
 	make run-docker-py-tests`
   for running a specific tests.  Run all tests by leaving the env
   variable empty.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>

Split handlers and server packages

The files were split to help contain bloat. The api/server package will
contain all code related to the functioning of the server while
api/handlers will have all the code related to implementing the end
points.

api/server/register_* will contain the methods for registering
endpoints.  Additionally, they will have the comments for generating the
swagger spec file.

See api/handlers/version.go for a small example handler,
api/handlers/containers.go contains much more complex handlers.

Signed-off-by: Jhon Honce <jhonce@redhat.com>

[CI:DOCS]enabled more tests

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]libpod endpoints

small refactor for libpod inclusion and began adding endpoints.

Signed-off-by: baude <bbaude@redhat.com>

Implement /build and /events

* Include crypto libraries for future ssh work

Signed-off-by: Jhon Honce <jhonce@redhat.com>

[CI:DOCS]more image implementations

convert from using for to query structs among other changes including
new endpoints.

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]add bindings for golang

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]add volume endpoints for libpod

create, inspect, ls, prune, and rm

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]apiv2 healthcheck enablement

wire up container healthchecks for the api.

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]Add mount endpoints

via the api, allow ability to mount a container and list container
mounts.

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]Add search endpoint

add search endpoint with golang bindings

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]more apiv2 development

misc population of methods, etc

Signed-off-by: baude <bbaude@redhat.com>

rebase cleanup and epoch reset

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]add more network endpoints

also, add some initial error handling and convenience functions for
standard endpoints.

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]use helper funcs for bindings

use the methods developed to make writing bindings less duplicative and
easier to use.

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]add return info for prereview

begin to add return info and status codes for errors so that we can
review the apiv2

Signed-off-by: baude <bbaude@redhat.com>

[CI:DOCS]first pass at adding swagger docs for api

Signed-off-by: baude <bbaude@redhat.com>
2020-01-10 09:41:39 -06:00
..
cliconfig Add `untag` sub-command 2020-01-08 10:06:10 +01:00
libpodruntime codespell: spelling corrections 2019-11-13 08:15:00 +11:00
remoteclientconfig codespell: spelling corrections 2019-11-13 08:15:00 +11:00
shared Merge pull request #4748 from NevilleC/nc-podname 2019-12-29 12:16:43 +01:00
varlink Merge pull request #4802 from rhatdan/varlink 2020-01-09 10:40:20 +01:00
README.md Replace "podman" with "Podman" 2019-09-07 20:16:42 +08:00
attach.go Use terminal detach keys sequence specified in the config file 2019-12-06 09:30:26 +01:00
build.go Initial commit on compatible API 2020-01-10 09:41:39 -06:00
checkpoint.go podman rm/stop --cidfile 2019-11-18 14:44:08 +01:00
cleanup.go podman rm/stop --cidfile 2019-11-18 14:44:08 +01:00
commands.go podman-remote image trust is broken 2019-09-11 16:03:45 -04:00
commands_remoteclient.go Implement healthcheck for remote client 2019-08-19 12:14:54 -04:00
commit.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
common.go Usage messages: show possible option values 2020-01-08 14:24:43 -07:00
common_libpod.go libpod removal from main (phase 2) 2019-06-27 07:56:24 -05:00
common_test.go Revert "Switch to golangci-lint" 2019-04-05 20:09:45 -05:00
container.go podman-remote: cp crashes 2019-08-21 14:53:23 -05:00
containers_prune.go filter added to container prune command 2019-11-29 15:28:55 +09:00
cp.go cp: drop check for rootless 2020-01-10 11:23:45 +01:00
create.go fix bug check nonexist authfile 2019-11-05 21:32:18 -05:00
diff.go golangci-lint round #3 2019-07-21 14:22:39 -05:00
errors.go Add new exit codes to rm & rmi for running containers & dependencies 2019-08-01 03:40:29 -04:00
errors_remote.go Add new exit codes to rm & rmi for running containers & dependencies 2019-08-01 03:40:29 -04:00
events.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
exec.go allow exec to read files of environment variables 2019-12-11 09:21:24 -06:00
exists.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
export.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
generate.go generate systemd: drop support for remote clients 2019-08-21 09:41:07 +02:00
generate_kube.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
generate_systemd.go generate systemd: support pods and geneartig files 2019-08-21 17:28:30 +02:00
healthcheck.go Implement healthcheck for remote client 2019-08-19 12:14:54 -04:00
healthcheck_run.go Implement conmon exec 2019-07-22 15:57:23 -04:00
history.go golangci-lint round #3 2019-07-21 14:22:39 -05:00
image.go Add `untag` sub-command 2020-01-08 10:06:10 +01:00
images.go move image filters under libpod/images 2019-12-10 13:05:18 -06:00
images_prune.go filter added to image pruge command. 2019-11-22 17:36:27 +09:00
import.go goland autocorrections 2019-10-29 12:18:50 -05:00
info.go Fixed the JSON go template format for the 'info' action 2019-11-01 23:36:17 -04:00
init.go podman rm/stop --cidfile 2019-11-18 14:44:08 +01:00
inspect.go inspect: rename ImageID go field to Image 2019-10-15 12:16:47 +02:00
kill.go signal parsing - better input validation 2019-12-26 16:50:21 -07:00
load.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
login.go fix bug check nonexist authfile 2019-11-05 21:32:18 -05:00
logout.go fix bug check nonexist authfile 2019-11-05 21:32:18 -05:00
logs.go logs: support --tail 0 2019-10-31 19:55:36 +01:00
main.go Add `untag` sub-command 2020-01-08 10:06:10 +01:00
main_local.go Usage messages: show possible option values 2020-01-08 14:24:43 -07:00
main_remote.go Allow setting default parameters with env vars 2019-10-01 19:46:57 +02:00
main_remote_supported.go enable windows remote client 2019-08-08 20:05:08 -05:00
main_remote_windows.go enable windows remote client 2019-08-08 20:05:08 -05:00
mount.go podman rm/stop --cidfile 2019-11-18 14:44:08 +01:00
network.go podman network create 2019-09-09 09:32:43 -05:00
network_create.go macvlan networks 2019-12-09 08:40:40 -06:00
network_inspect.go inclusion of podman network 2019-08-15 12:49:12 -05:00
network_list.go inclusion of podman network 2019-08-15 12:49:12 -05:00
network_rm.go enhance podman network rm 2019-09-12 14:03:52 -05:00
pause.go Use exit code constants 2019-09-12 16:20:01 -04:00
platform_linux.go rootless: skip check fo /etc/containers/registries.conf 2019-05-30 09:01:55 +02:00
platform_unsupported.go Add darwin support for remote-client 2019-01-11 11:30:28 -06:00
play.go More cleanup for failures on missing commands. 2019-03-08 07:06:50 -05:00
play_kube.go play kube: make seccomp handling better conform to k8s 2020-01-03 13:27:17 -05:00
pod.go Add podman pod prune 2019-04-16 11:23:18 -04:00
pod_create.go Allow customizing pod hostname 2019-08-18 03:48:40 +00:00
pod_inspect.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
pod_kill.go signal parsing - better input validation 2019-12-26 16:50:21 -07:00
pod_pause.go podman rm/stop --cidfile 2019-11-18 14:44:08 +01:00
pod_ps.go golangci-lint round #3 2019-07-21 14:22:39 -05:00
pod_restart.go podman rm/stop --cidfile 2019-11-18 14:44:08 +01:00
pod_rm.go Remove containers when pruning a stopped pod. 2019-11-26 13:19:31 -05:00
pod_start.go podman rm/stop --cidfile 2019-11-18 14:44:08 +01:00
pod_stats.go cmd, stats: fix check for rootless mode 2019-08-12 12:03:53 +02:00
pod_stop.go podman {pod,} rm/stop: add --ignore flag 2019-11-25 09:48:13 +01:00
pod_top.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
pod_unpause.go podman rm/stop --cidfile 2019-11-18 14:44:08 +01:00
pods_prune.go Remove containers when pruning a stopped pod. 2019-11-26 13:19:31 -05:00
port.go podman rm/stop --cidfile 2019-11-18 14:44:08 +01:00
ps.go Merge pull request #4748 from NevilleC/nc-podname 2019-12-29 12:16:43 +01:00
pull.go fix bug check nonexist authfile 2019-11-05 21:32:18 -05:00
push.go fix bug check nonexist authfile 2019-11-05 21:32:18 -05:00
refresh.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
reset.go Add podman system reset command 2019-11-29 05:34:52 -05:00
restart.go podman rm/stop --cidfile 2019-11-18 14:44:08 +01:00
restore.go podman rm/stop --cidfile 2019-11-18 14:44:08 +01:00
rm.go podman {pod,} rm/stop: add --ignore flag 2019-11-25 09:48:13 +01:00
rmi.go add struct response for removal of images 2019-12-23 10:02:14 -06:00
run.go fix bug check nonexist authfile 2019-11-05 21:32:18 -05:00
runlabel.go fix bug check nonexist authfile 2019-11-05 21:32:18 -05:00
save.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
search.go fix bug check nonexist authfile 2019-11-05 21:32:18 -05:00
sign.go bump containers/image to v5.0.0, buildah to v1.11.4 2019-10-29 13:35:18 -04:00
start.go Use terminal detach keys sequence specified in the config file 2019-12-06 09:30:26 +01:00
stats.go codespell: spelling corrections 2019-11-13 08:15:00 +11:00
stop.go podman {pod,} rm/stop: add --ignore flag 2019-11-25 09:48:13 +01:00
system.go Add podman system reset command 2019-11-29 05:34:52 -05:00
system_df.go fix system df crashes on unnamed images 2019-08-04 10:00:29 -04:00
system_migrate.go Migrate can move containers to a new runtime 2019-10-10 10:25:06 -04:00
system_prune.go filter added to container prune command 2019-11-29 15:28:55 +09:00
system_renumber.go Discard errors from Shutdown in `system renumber` 2019-11-22 17:27:06 -05:00
tag.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
top.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
tree.go Initial commit on compatible API 2020-01-10 09:41:39 -06:00
trust.go podman-remote image trust is broken 2019-09-11 16:03:45 -04:00
trust_set_show.go golangci-lint round #3 2019-07-21 14:22:39 -05:00
umount.go podman rm/stop --cidfile 2019-11-18 14:44:08 +01:00
unpause.go Use exit code constants 2019-09-12 16:20:01 -04:00
unshare.go libpod removal from main (phase 2) 2019-06-27 07:56:24 -05:00
untag.go Add `untag` sub-command 2020-01-08 10:06:10 +01:00
utils.go Validate contextdir on build 2019-11-01 09:57:56 -04:00
varlink.go Merge pull request #3760 from rhatdan/auth 2019-08-19 21:16:06 +02:00
varlink_dummy.go Only build varlink when buildtag is available 2019-02-12 15:53:19 -06:00
version.go Fix podman-remote version to print client and server 2019-12-02 15:50:00 +01:00
volume.go More cleanup for failures on missing commands. 2019-03-08 07:06:50 -05:00
volume_create.go Add parsing for UID, GID in volume "o" option 2019-10-22 14:32:54 -04:00
volume_inspect.go Swap 'volume inspect' frontend to use the new backend 2019-08-02 15:08:30 -04:00
volume_ls.go golangci-lint round #3 2019-07-21 14:22:39 -05:00
volume_prune.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
volume_rm.go Add function for looking up volumes by partial name 2019-09-09 12:06:10 -04:00
wait.go first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00

README.md

Podman - Simple debugging tool for pods and images

Podman is a daemonless container runtime for managing containers, pods, and container images. It is intended as a counterpart to CRI-O, to provide low-level debugging not available through the CRI interface used by Kubernetes. It can also act as a container runtime independent of CRI-O, creating and managing its own set of containers.

Use cases

  1. Create containers
  2. Start, stop, signal, attach to, and inspect existing containers
  3. Run new commands in existing containers
  4. Push and pull images
  5. List and inspect existing images
  6. Create new images by committing changes within a container
  7. Create pods
  8. Start, stop, signal, and inspect existing pods
  9. Populate pods with containers