6894 Commits

Author SHA1 Message Date
e561280510 Merge pull request #5204 from baude/apiv2createlibpod
apiv2 container create using specgen
2020-02-19 23:49:06 +01: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
3db43dcce3 Add test to validate the pod bindings api
Include test to validate pod create, start, stop, restart,
pause, unpause, list, and inspect api bindings.
Also includes bug fixes that resulted in invalid api responses.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-02-19 16:05:27 -05:00
96de762eed Update to the latest version of buildah
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-19 16:04:00 -05:00
67c1b7e3b4 New login and push tests
Test podman login/logout, login with wrong credentials,
auth file contents, auth file path override, push/pull,
and, if skopeo is installed, credentials sharing

Fixes: #4283

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-02-19 09:51:06 -07:00
f2bcc9cc7d Merge pull request #5258 from containers/dependabot/go_modules/github.com/containers/storage-1.16.0
build(deps): bump github.com/containers/storage from 1.15.8 to 1.16.0
2020-02-19 17:50:11 +01:00
aa1bb0b579 Merge pull request #5259 from schubter/apiv2-create-image
APIv2: Fixed CreateImageFromImage not respecting supplied Tag parameter
2020-02-19 17:30:37 +01:00
5a0b5c5640 Merge pull request #5257 from containers/dependabot/go_modules/github.com/stretchr/testify-1.5.0
build(deps): bump github.com/stretchr/testify from 1.4.0 to 1.5.0
2020-02-19 17:30:29 +01:00
da249e2fe2 Merge pull request #5225 from vrothberg/fix-5087
config: use built-in TOML merge and adhere to label setting
2020-02-19 17:30:21 +01:00
97323808ed Add network options to podman pod create
Enables most of the network-related functionality from
`podman run` in `podman pod create`. Custom CNI networks can be
specified, host networking is supported, DNS options can be
configured.

Also enables host networking in `podman play kube`.

Fixes #2808
Fixes #3837
Fixes #4432
Fixes #4718
Fixes #4770

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-19 11:29:30 -05:00
7efcca2818 Merge pull request #5248 from rhatdan/precommit
Add installation of pre-commit to Makefile
2020-02-19 16:56:04 +01:00
8c0df03deb Merge pull request #5261 from schubter/killContainer
Fixed typo in KillContainer
2020-02-19 15:41:54 +01:00
cba5791a5d Merge pull request #5233 from QiWang19/login/out-parameter
fix mandatory parameter in login/logout
2020-02-19 15:11:54 +01:00
3aa32dff1d Fixed syscall.Signal not convertable by decoder
Signed-off-by: Andreas Schubert <schubter@gmail.com>
2020-02-19 15:04:24 +01:00
1e4129a19d Fixed typo in KillContainer
Signed-off-by: Andreas Schubert <schubter@gmail.com>
2020-02-19 13:48:10 +01:00
7f411cb325 Review comments
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-02-19 17:14:20 +05:30
88a8d9e3fa [WIP] Add cmd flag to show container name in log
This flag allows user to show container name in podman log command

Fixes: #4962

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-02-19 16:58:04 +05:30
86be569961 build(deps): bump github.com/containers/storage from 1.15.8 to 1.16.0
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.15.8 to 1.16.0.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.15.8...v1.16.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-19 11:40:53 +01:00
74290c4b36 build(deps): bump github.com/stretchr/testify from 1.4.0 to 1.5.0
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.4.0...v1.5.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-19 11:37:20 +01:00
0fcaa93573 libpod.conf: clarify label description
Clarify that the label option sets the defaults which can still be
overriden by the CLI.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-19 11:04:02 +01:00
58cbbbc56e set process labels in pkg/spec
Set the (default) process labels in `pkg/spec`. This way, we can also
query libpod.conf and disable labeling if needed.

Fixes: #5087
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-19 11:04:02 +01:00
b7b9f8d0cf libpod/config: use built-in TOML instead of manually merging
Instead of manually merging the configs, use the built-in features of
TOMP to merge/extend the fields of a data type when encoding a file.
This erases the need for the merge code in libpod/config and also
addresses issues when merging booleans.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-19 11:04:02 +01:00
6e5cf818e9 Fixed CreateImageFromImage not respecting supplied Tag parameter
Signed-off-by: Andreas Schubert <schubter@gmail.com>
2020-02-19 10:36:44 +01:00
1bed53b02c Merge pull request #5247 from schubter/5242
APIv2: fixes decoder issue
2020-02-19 03:45:02 +01:00
00e9db0822 Add installation of pre-commit to Makefile
pre-commit is required for running certain tests by the Makefile.
Adding pre-commit to install.tools allows users to easily use
and test podman.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-18 16:59:31 -05:00
c58926e54b Merge pull request #5243 from Akasurde/misc_typo
Misc typo fixes
2020-02-18 21:58:14 +01:00
4c135017b2 fix mandatory parameter in login/logout
fix #5146
Insted of using a registry as mandatory parameter, this path allows podman to use the first registry from registries.conf.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-02-18 15:30:49 -05:00
3be1221aea Merge pull request #5245 from giuseppe/rootless-portmapping-detach
rootless: fix a regression when using -d
2020-02-18 21:19:00 +01:00
4b96c3b2c8 adds missing query struct tags and exports the fields
Signed-off-by: Andreas Schubert <schubter@gmail.com>
2020-02-18 21:10:55 +01:00
931eb1b583 Merge pull request #5231 from edsantiago/swagger_fixes
Swagger: fix inconsistencies (try #2)
2020-02-18 20:09:46 +01: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
a5d55966bd Merge pull request #5235 from jwhonce/issues/5229
Update mux rules to allow slashes in image names
2020-02-18 19:00:16 +01:00
024ddda123 Update mux rules to allow slashes in image names
%2F escaping is also supported.
Return better response on bad search terms

Fixes #5229

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-02-18 09:38:37 -07:00
5dacee9395 Merge pull request #5223 from vrothberg/ps-image-id
podman-ps: support image IDs
2020-02-18 16:11:28 +01:00
170fd7b038 rootless: fix a regression when using -d
when using -d and port mapping, make sure the correct fd is injected
into conmon.

Move the pipe creation earlier as the fd must be known at the time we
create the container through conmon.

Closes: https://github.com/containers/libpod/issues/5167

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-02-18 15:33:38 +01:00
bc20cb9281 Merge pull request #5158 from jwhonce/issues/5151
Fix handler and systemd activation errors
2020-02-18 15:24:02 +01:00
9419807cef Misc typo fixes
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-02-18 16:00:36 +05:30
40fa7e9931 Use cleaned destination path for indexing image volumes
We use filepath.Clean() to remove trailing slashes to ensure that
when we supercede image mounts with mounts from --volume and
--mount, paths are consistent when we compare. Unfortunately,
while we used the cleaned path for the destination in the mount,
it was accidentally not used to index the maps that we use to
identify what to supercede, so our comparisons might be thrown
off by trailing slashes and similar.

Fixes #5219

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-17 16:28:36 -05:00
666d8cf1de Add ability for pods to use the host network
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-17 16:21:07 -05:00
0bd29f89e9 Merge pull request #5237 from giuseppe/check-for-valid-conmon-process
rootless: check if the conmon process is valid
2020-02-17 21:15:41 +01:00
98774e1476 stats: Expose CPU usage in API
`stats.CPU` is a number representing CPU usage in percents. It is possible
to calculate it from other exposed fields (once they are implemented
correctly) but why to do it, when this is already calculated.

This does not break API, it just adds another field.

Signed-off-by: Matej Marusak <mmarusak@redhat.com>
2020-02-17 20:05:14 +01:00
e9dc212092 rootless: check if the conmon process is valid
if the pause process doesn't exist and  we try to join a conmon
namespace, make sure the process still exists.  Otherwise re-create
the user namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-02-17 19:11:41 +01:00
b6e0692466 apiv2: Fixup /containers/json filters documentation
Mention what is the input format plus put literals into quotation marks
for better readability (plus it seems that some tags were not rendered).

Signed-off-by: Matej Marusak <mmarusak@redhat.com>
2020-02-17 18:54:50 +01:00
d08e0c728f apiv2: Enable filtering images by ID
It is more practical for API usage and also it is more in sync how
filtering of containers works.

Signed-off-by: Matej Marusak <mmarusak@redhat.com>
2020-02-17 18:44:46 +01:00
c0c44ae8a3 Fix handler and systemd activation errors
On panic from handler: log warning and stack trace, report
InternalServerError to client

When using `podman system service` make determining the listening endpoint deterministic.

  // When determining _*THE*_ listening endpoint --
  // 1) User input wins always
  // 2) systemd socket activation
  // 3) rootless honors XDG_RUNTIME_DIR
  // 4) if varlink -- adapter.DefaultVarlinkAddress
  // 5) lastly adapter.DefaultAPIAddress

Fixes #5150
Fixes #5151

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-02-17 10:29:32 -07:00
640b11f002 Merge pull request #5093 from openSUSE/image-tree
Refactor image tree for API usage
2020-02-17 17:24:28 +01:00
3c2cc67867 podman-ps: support image IDs
Support printing image IDs via `--format "{{.ImageID}}"`.

Fixes: #5160
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-17 15:22:21 +01:00
93358ef915 Refactor image tree for API usage
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-02-17 11:12:35 +01:00
ff0f838813 Merge pull request #5218 from Jumanjii/update-go-md2man-pkg-name
Update documentation of commit command to show image reference is optional
2020-02-17 08:47:08 +01:00
92dbcb8841 Merge pull request #5217 from mheon/rework_label_parsing
Rework label parsing
2020-02-15 12:50:48 +01:00