10478 Commits

Author SHA1 Message Date
53c8bc5a5e Jira RUN-1106 Network handlers updates
* Add network API tests
* Update network create endpoint to return ID not Name

Audit:
- GET /networks ListNetworks
- GET /networks/{id} InspectNetwork
- DELETE /networks/{id} RemoveNetwork
- POST /networks/create CreateNetwork
- POST /networks/prune 405 not implemented

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-12-04 13:44:33 -07:00
07af857961 Merge pull request #8596 from afbjorklund/password-callback
Use PasswordCallback instead of Password for ssh
2020-12-04 15:38:08 -05:00
c55b83195e Merge pull request #8598 from rzlourenco/master
[CI:DOCS] Clarify uid range requirements
2020-12-04 14:14:50 -05:00
95c45773d7 Do not mount sysfs as rootless in more cases
We can't mount sysfs as rootless unless we manage the network
namespace. Problem: slirp4netns is now creating and managing a
network namespace separate from the OCI runtime, so we can't
mount sysfs in many circumstances. The `crun` OCI runtime will
automatically handle this by falling back to a bind mount, but
`runc` will not, so we didn't notice until RHEL gating tests ran
on the new branch.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-12-04 13:49:56 -05:00
d6d3af9e8e Add ability to set system wide options for slirp4netns
Wire in containers.conf options for slirp

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-12-04 13:37:22 -05:00
90d41104d9 Vendor in containers/common v0.30.0
Signed-off-by: Ashley Cui <acui@redhat.com>
2020-12-04 13:35:00 -05:00
0f496e4b81 Merge pull request #8570 from vrothberg/run-950
rewrite container copy
2020-12-04 13:33:36 -05:00
6724609769 Clarify uid range requirements
Signed-off-by: Rodrigo Lourenço <rzl@rzl.ooo>
2020-12-04 18:27:00 +00:00
d2f6f153ea Close image rawSource when each loop ends
Previously close rawSouce in the middle makes future use of rawSource invalid.
Move the rawSource.Close() to the end of each loop.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-12-04 13:16:16 -05:00
f01630acf3 Merge pull request #8476 from rhatdan/containerenv
Add containerenv information to /run/.containerenv
2020-12-04 11:56:24 -05:00
a2d536e597 Merge pull request #8584 from jwhonce/jira/RUN-1106-containers
Jira RUN-1106 Container handlers updates
2020-12-04 11:15:27 -05:00
aaade40780 Use PasswordCallback instead of Password for ssh
Currently asking for login password, even if not supported by
the ssh server. So wait with prompt until actually requested.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2020-12-04 17:09:49 +01:00
15d36f120c More docker compat API fixes
Fixes wrong VirtualSize, ParentId, Architecture, Author, Os and OsVersion value

Signed-off-by: Milivoje Legenovic <m.legenovic@gmail.com>
2020-12-04 15:58:46 +01:00
ccbca0b4ab rewrite podman-cp
* Add a new `pkg/copy` to centralize all container-copy related code.

* The new code is based on Buildah's `copier` package.

* The compat `/archive` endpoints use the new `copy` package.

* Update docs and an several new tests.

* Includes many fixes, most notably, the look-up of volumes and mounts.

Breaking changes:

 * Podman is now expecting that container-destination paths exist.
   Before, Podman created the paths if needed.  Docker does not do
   that and I believe Podman should not either as it's a recipe for
   masking errors.  These errors may be user induced (e.g., a path
   typo), or internal typos (e.g., when the destination may be a
   mistakenly unmounted volume).  Let's keep the magic low for such
   a security sensitive feature.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-12-04 14:39:55 +01:00
ec0411aecd Merge pull request #8569 from zhangguanzhang/fix-nit
Fix some nit in code and comment
2020-12-04 06:30:31 -05:00
05df0c50ae Merge pull request #8589 from yan12125/container-logs-unix-timestamps
Support Unix timestamps for `podman logs --since`
2020-12-04 06:28:34 -05:00
d1193b1b8c Merge pull request #8587 from jwhonce/jira/RUN-1106-images
Jira RUN-1106 Image handlers updates
2020-12-04 06:23:16 -05:00
a3cb37a04f Merge pull request #8590 from vrothberg/owners
add @Luap99 to OWNERS file
2020-12-04 06:16:22 -05:00
8dab410181 e2e: bump pull timeout to 240 seconds
I am constantly hitting the 90 seconds limit with my very slow
connection.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-12-04 11:43:17 +01:00
701cc6ab40 add @Luap99 to OWNERS file
@Luap99 is a long-term contributor, does a lot of reviews, contributed
many non-trivial patches, and is very active in the community.

Being in the OWNERS file gives privileges to approve (/approve) and
merge (/lgtm) pull requests.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-12-04 09:21:04 +01:00
e58fb21ced Support Unix timestamps for podman logs --since
To match what podman-logs(1) describes --since

Signed-off-by: Chih-Hsuan Yen <yan12125@gmail.com>
2020-12-04 15:14:31 +08:00
95b4478fb4 Fix some nit
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-12-04 09:20:42 +08:00
468947d5c8 Jira RUN-1106 Image handlers updates
* Audit and add tests for required fields.
* Added issue for /images/load implementation

Audit:
- GET /images/json GetImages
- POST /build BuildImage
- POST /build/prune 404 not found
- POST /images/create CreateImageFromImage/CreateImageFromSrc
- GET /images/{name}/json GetImage
- GET /images/{name}/history HistoryImage
- POST /images/{name}/push PushImage
- POST /images/{name}/tag TagImage
- DELETE /images/{name} RemoveImage
- POST /images/prune PruneImages
- POST /commit CommitContainer
- GET /images/{name}/get ExportImage
- GET /images/get ExportImages
- POST /images/load LoadImages See https://github.com/containers/podman/issues/8586

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-12-03 16:11:17 -07:00
767afe01db Jira RUN-1106 Container handlers updates
Mostly audit and minor changes to nil from ""

Audit:
- GET /containers/json ListContainers
- POST /containers/create CreateContainer
- GET /containers/{id}/json GetContainer
- GET /containers/{id}/top TopContainer
- GET /containers/{id}/logs LogsFromContainer
- GET /containers/{id}/changes Changes
- GET /containers/{id}/export ExportContainer
- GET /containers/{id}/stats StatsContainer
- POST /containers/{id}/resize ResizeTTY
- POST /containers/{id}/start StartContainer
- POST /containers/{id}/stop StopContainer
- POST /containers/{id}/restart RestartContainer
- POST /containers/{id}/kill KillContainer
- POST /containers/{id}/update 404 not supported
- POST /containers/{id}/rename 404 not supported
- POST /containers/{id}/pause PauseContainer
- POST /containers/{id}/unpause UnpauseContainer
- POST /containers/{id}/attach AttachContainer
- GET /containers/{id}/attach/ws 404 not supported
- POST /containers/{id}/wait WaitContainer
- DELETE /containers/{id} RemoveContainer
- HEAD /containers/{id}/archive Archive
- GET /containers/{id}/archive Archive
- PUT /containers/{id}/archive Archive
- POST /containers/prune PruneContainers

Images etc PR's will follow.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-12-03 13:49:22 -07:00
d9154e97eb Add containerenv information to /run/.containerenv
We have been asked to leak some information into the container
to indicate:
* The name and id of the container
* The version of podman used to launch the container
* The image name and ID the container is based on.
* Whether the container engine is running in rootless mode.

Fixes: https://github.com/containers/podman/issues/6192

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-03 13:32:15 -05:00
70284b18cc Merge pull request #8479 from rhatdan/log
Drop default log-level from error to warn
2020-12-03 10:59:33 -05:00
c675d8a3c6 Merge pull request #8565 from jwhonce/wip/testing
hack/podman-socat captures the API stream
2020-12-03 10:24:19 -05:00
3fd350f050 Merge pull request #8576 from Luap99/docs-network-rootless
[CI:DOCS] Correct which network commands can be run as rootless
2020-12-03 10:22:03 -05:00
caa84cd35d Merge pull request #8551 from rhatdan/default
Support --network=default as if it was private
2020-12-03 09:31:43 -05:00
8437a6df16 Correct which network commands can be run as rootless
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-12-03 14:43:37 +01:00
f00cc25a7c Drop default log-level from error to warn
Our users are missing certain warning messages that would
make debugging issues with Podman easier.

For example if you do a podman build with a Containerfile
that contains the SHELL directive, the Derective is silently
ignored.

If you run with the log-level warn you get a warning message explainging
what happened.

$ podman build --no-cache -f /tmp/Containerfile1 /tmp/
STEP 1: FROM ubi8
STEP 2: SHELL ["/bin/bash", "-c"]
STEP 3: COMMIT
--> 7a207be102a
7a207be102aa8993eceb32802e6ceb9d2603ceed9dee0fee341df63e6300882e

$ podman --log-level=warn build --no-cache -f /tmp/Containerfile1 /tmp/
STEP 1: FROM ubi8
STEP 2: SHELL ["/bin/bash", "-c"]
STEP 3: COMMIT
WARN[0000] SHELL is not supported for OCI image format, [/bin/bash -c] will be ignored. Must use `docker` format
--> 7bd96fd25b9
7bd96fd25b9f755d8a045e31187e406cf889dcf3799357ec906e90767613e95f

These messages will no longer be lost, when we default to WARNing level.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-03 06:28:09 -05:00
85b412ddcd Merge pull request #8563 from giuseppe/exec-cgroup-create
podman, exec: move conmon to the correct cgroup
2020-12-03 11:37:13 +01:00
9a33e064a1 podman, exec: move conmon to the correct cgroup
move the conmon process to the conmon cgroup also on exec.

The previous implementation would fail to move the conmon process as
the systemd unit already exists so its creation would fail.

When the unit cannot be created, attempt to directly join the cgroup
instead.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-12-03 10:03:39 +01:00
918087252b Merge pull request #8566 from jwhonce/wip/double_ping
Change bindings to stop two API calls for ping
2020-12-03 01:45:38 +01:00
38a44acd20 Merge pull request #8564 from edsantiago/bats
BATS: add new load test
2020-12-03 01:25:54 +01:00
5cf7aa65fb Merge pull request #8408 from umohnani8/sec-opt
Add mask and unmask option to --security-opt
2020-12-03 00:49:23 +01:00
ee418c8565 Support --network=default as if it was private
Docker defines an option of "default" which means to
use the default network.  We should support this with
the same code path as --network="".

This is important for compatibility with the Docker API.

Fixes: https://github.com/containers/podman/issues/8544

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-02 18:38:35 -05:00
60d3e658ce Change bindings to stop two API calls for ping
* existing code caused an unnecessary 301 redirect

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-12-02 16:14:53 -07:00
e55320efde hack/podman-socat captures the API stream
* verify socat and podman binaries exist
* setup a sandboxed podman service
* run podman service with socat proxy to capture API stream
* clean up sandbox leaving the log files for review

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-12-02 16:03:56 -07:00
c8ab4c878f BATS: add new load test
Looks like #7337 was fixed (by #8112). Reenable a disabled
test for it; and make it actually work. Confirmed that
newly-added test fails on d45676549 (the commit before #8112).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-12-02 14:45:51 -07:00
0334b61958 Add mask and unmask option to --security-opt
Add the mask and unmask option to the --security-opt flag
to allow users to specify paths to mask and unmask in the
container. If unmask=ALL, this will unmask all the paths we
mask by default.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2020-12-02 16:07:18 -05:00
7984842d7e Merge pull request #8556 from mheon/fix_8539
Use Libpod tmpdir for pause path
2020-12-02 22:03:19 +01:00
e74072e742 Merge pull request #8112 from QiWang19/load-optional-name
Drop name argument from Load API
2020-12-02 21:35:31 +01:00
d45676549d Merge pull request #8392 from jwhonce/wip/report
Fix `podman images...` missing headers in table templates
2020-12-02 20:25:54 +01:00
ab88632835 Use Libpod tmpdir for pause path
Previously, we always computed pause path from the Rootless
runtime directory. Problem: this does not match the behavior of
Libpod when the directory changes. Libpod will continue to use
the previous directory, cached in the database; Pause pidfiles
will swap to the new path. This is problematic when the directory
needs to exist to write the pidfile, and Libpod is what creates
the directory.

There are two potential solutions - allow the pause pidfile to
move and just make the directory when we want to write it, or use
the cached Libpod paths for a guaranteed location. This patch
does the second, because it seems safer - we will never miss a
previously-existing pidfile because the location is now
consistent.

Fixes #8539

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-12-02 14:18:37 -05:00
2e55543cca Merge pull request #8557 from baude/mountcommas
add commas between mount options
2020-12-02 19:52:52 +01:00
2a02833e9f Fix podman images... missing headers in table templates
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-12-02 10:50:37 -07:00
ccc0201a64 add commas between mount options
when formatting mount options into a string for the compat container create, the options need to be comma delimited.

Signed-off-by: baude <bbaude@redhat.com>
2020-12-02 10:19:21 -06:00
e82ec90007 Merge pull request #8552 from baude/buildtarget
target is not tag
2020-12-02 16:58:28 +01:00
7210b86d9e Merge pull request #8549 from Luap99/network-id-support
Add support for network ids
2020-12-02 15:27:14 +01:00