31 Commits

Author SHA1 Message Date
094b11cbcb Merge pull request #12908 from Luap99/network-conf-dir
rename --cni-config-dir to --network-config-dir
2022-01-18 15:42:06 -05:00
c0e0723463 rename --cni-config-dir to --network-config-dir
Since this option will also be used for netavark we should rename it to
something more generic. It is important that --cni-config-dir still
works otherwise we could break existing container cleanup commands.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-18 19:28:25 +01:00
7e30531f20 compat attach: fix write on closed channel
Waiting on an initialized sync.WaitGroup returns immediately.
Hence, move the goroutine to wait and close *after* reading
the logs.

Fixes: #12904
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2022-01-18 16:32:38 +01:00
8f2358eeaa Add podman rm --depend
This option causes Podman to not only remove the specified containers
but all of the containers that depend on the specified
containers.
Fixes: https://github.com/containers/podman/issues/10360

Also ran codespell on the code

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-11 14:33:54 -05:00
449cc7a5c2 Implement top streaming for containers and pods
* Implement API query parameter stream and delay for containers and
  pods top endpoints
* Update swagger with breaking changes
* Add python API tests for endpoints

Fixes #12115

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-11-02 08:11:14 -07:00
98506c961b Allow label and labels when creating volumes
JSON payload may have either key. Labels will override any values set
via Label.

Fixes #12102

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-10-28 16:02:22 -07:00
1199733754 podman inspect add State.Health field for docker compat
podman inspect shows the healthcheck status in `.State.Healthcheck`,
docker uses `.State.Health`. To make sure docker scripts work we
should add the `Health` key. Because we do not want to display both keys
by default we only use the new `Health` key. This is a breaking change
for podman users but matches what docker does. To provide some form of
compatibility users can still use `--format {{.State.Healthcheck}}`. IT
is just not shown by default.

Fixes #11645

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-23 14:44:34 +02:00
5242030ac2 compat API: /images/json prefix image id with sha256
Docker adds the `sha256:` prefix to the image ID, so our compat endpoint
has to do this as well.

Fixes #11623

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-20 13:47:29 +02:00
d7256be807 Enhance bindings for IDE hints
* Follow https://pkg.go.dev/cmd/go#hdr-Generate_Go_files_by_processing_source
  for leading comment
* Add godoc strings for all exposed methods for IDE support
* Copy field godoc strings into generated code as function godoc string
* Remove unused/unnecessary fields from generator.go structures
* Cleanup code regarding template usage

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-09-14 07:47:24 -07:00
b603c7a4b9 Merge pull request #11529 from n1hility/fix-oldfields
Add deprecated event fields for 1.22+ clients that still expect them
2021-09-13 17:17:28 -04:00
3c77a98e45 Add deprecated fields for 1.22+ clients that still expect them
Signed-off-by: Jason Greene <jason.greene@redhat.com>
2021-09-10 20:08:45 -05:00
deaf969243 Refacter API server emphasis on logging
* To aid in debugging log API request and response bodies at trace
  level. Events can be correlated using the X-Reference-Id.
* Server now echos X-Reference-Id from client if set, otherwise
  generates an unique id.
* Move logic for X-Reference-Id into middleware
* Change uses of Header.Add() to Set() when setting Content-Type
* Log API operations in Apache format using gorilla middleware
* Port server code to use BaseContext and ConnContext

Fixes #10053

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-09-10 15:07:25 -07:00
fd32c73e3a Update /version endpoint to add components
* Include OCI and conmon information as components

Fixes #11227

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-08-19 14:19:45 -07:00
12ac4198ca Libpod images pull changes
Added quiet param to docs to limit stream output. Formatted JSON.

fixes #10612

Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
Signed-off-by: cdoern <cdoern@redhat.com>
2021-08-09 14:17:08 -04:00
a210a22920 Compat API: Fix healthcheck status and healthcheck config
Fixes:

- Do not show healthcheck status if not available or if container
  status is "created" (Docker behaviour)
- Show healthcheck configuration if present (Config.Healthcheck)

Tests:

- Ensure State.Health is not present if container status is "created"
- Ensure Config.Healthcheck is present and values correct
- Ensure State.Health is present if container started

Signed-off-by: Milivoje Legenovic <m.legenovic@gmail.com>
2021-08-03 15:38:04 +02:00
fd1f57b3a6 Fixed Healthcheck formatting, string to []string
Compat healthcheck tests are of the format []string but podman's were of
the format string. Converted podman's to []string at the specgen level since it has the same effect
and removed the incorrect parsing of compat healthchecks.

fixes #10617

Signed-off-by: cdoern <cdoern@redhat.com>
2021-07-26 16:58:38 -04:00
4624142c2d Implemented Until Query Parameter for Containers/logs
compat containers/logs was missing actual usage of until query param.

fixes #10859

Signed-off-by: cdoern <cdoern@redhat.com>
2021-07-09 12:21:46 -04:00
b0a3ac3578 Merge pull request #10610 from cdoern/healthCheck
Edited compat handling code for containers/json status and added python tests
2021-06-23 14:45:29 -04:00
6ecdf4c389 Health Check is not handled in the compat LibpodToContainerJSON
Added parsing and handling for the healthCheck status within containers.go. Also modified tests

fixes #10457

Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
2021-06-23 13:16:19 -04:00
bd9987239d Scrub podman commands to use report package
Refactor podman commands that have drifted from using
c/common report pkg. Report pkg is needed to implement
go template functions.

Removed obsolete code from podman which exists in c/common.

Latest template library added default newlines and method to
remove them. Incorporated needed changes in c/common PR below.

Depends on https://github.com/containers/common/pull/624
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1855983

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-06-16 16:53:48 -07:00
3ddadc5326 Image import fromSrc now supports OS/Arch
added handling in entities and compat to support passing a specified OS/Arch while importing from SRC.

fixes #10566

Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
2021-06-14 09:05:01 -04:00
8e89d70713 [CI:DOCS] Update swagger for inspect network
struct for swagger was pointing to wrong internal type

Fixes #10559

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-06-08 15:23:46 -07:00
da1bade294 Merge pull request #10603 from cdoern/networksQuery
implemented verbose and scope as possible
2021-06-08 15:47:44 -04:00
5117deda04 fixed docs and schemas
Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
2021-06-08 14:23:05 -04:00
5d96b8e7d6 Merge pull request #10548 from cdoern/imgFeature
API images/create added missing parameters platform, message, repo
2021-06-08 17:44:02 +02:00
1f73374acd remote: always send resize before the container starts
There is race condition in the remote client attach logic. Because the
resize api call was handled in an extra goroutine the container was
started before the resize call happend. To fix this we have to call
resize in the same goroutine as attach. When the first resize is done
start a goroutine to listen on SIGWINCH in the background and resize
again if the signal is received.

Fixes #9859

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-04 16:55:48 +02:00
ce01b4f095 made requested changes, fixed api tests
Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
2021-06-04 09:50:42 -04:00
2cc4535e1f added tests in python rest api
Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
2021-06-01 14:54:02 -04:00
8bf852d5f0 Match swagger to "as built" output
* Remove all Types no longer referenced, they were never used

A future API breaking version of Podman API, may restore these Types
and push formatting into presentation layer vs. server.

Fixes #9578

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-05-21 09:50:58 -07:00
92e858914d fix: response body of containers wait endpoint
The `Error` part of response must be nil (or omitted) if no error occurred.
Before this commit a zero value for the struct was returned.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-05-18 20:52:09 +02:00
98955bedbc Break up python APIv2 tests
* Tests broken up into areas of concern
* Introduced fixtures to reduce duplicated code
* Introduced new assert methods with APITestCase
* General cleanup of code while visiting
* Tests now targeting quay.io

Known issues:
* is-official against quay.io not working

Fixes: #9238
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-05-18 08:39:35 -07:00