12954 Commits

Author SHA1 Message Date
44abc17977 libpod: honor --cgroups=split also with pods
Honor --cgroups=split also when the container is running in a pod.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-09-14 12:35:22 +02:00
65f3b16c67 tests: enable --cgroups=disabled test for rootless
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-09-14 11:43:45 +02:00
afe4d17be8 tests: simplify --cgroups=disabled test
read the cgroup directly from the container.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-09-14 11:23:36 +02:00
d3f0f09ad9 libpod: rootful close binded ports
For rootful users ports are forwarded via iptables. To make sure no
other process tries to use them, libpod will bind the ports and pass the
fds to conmon. There seems to be race when a container is restarted
because libpod tries to bind the port before the conmon process exited.

The problem only hapens with the podman service because it keeps the
connection open. Once we have the fd and passed it to conmon the
podman service should close the connection.

To verify run `sudo ss -tulpn` and check that only the conmon process
keeps the port open. Previously you would also see the podman server
process listed.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-14 11:13:28 +02:00
072b061b4e Search gvproxy with config.FindHelperBinary()
Closes #11531

[NO TESTS NEEDED]

Signed-off-by: Hyeon Kim <simnalamburt@gmail.com>
2021-09-14 17:14:55 +09:00
a55e2a00fc rootfs: Add support for rootfs-overlay and bump to buildah v1.22.1-0.202108
Allows users to specify a readonly rootfs with :O, in exchange podman will create a writable overlay.

bump builah to v1.22.1-0.20210823173221-da2b428c56ce

[NO TESTS NEEDED]

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2021-09-14 13:31:39 +05:30
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
6221f269a8 fix restart always with rootlessport
When a container is automatically restarted due its restart policy and
the container uses rootless cni networking with ports forwarded we have
to start a new rootlessport process since it exits with conmon.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-13 22:52:39 +02:00
d30facfda8 Cirrus: NM/CNI workaround + Remove prior-Ubuntu
Ref: https://github.com/containers/automation_images/pull/88

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-09-13 15:52:31 -04:00
473f958e13 Merge pull request #11545 from rhatdan/exitcodes
If container exits with 125 podman should exit with 125
2021-09-13 15:24:30 -04:00
55a7f89fca Merge pull request #11549 from containers/dependabot/go_modules/github.com/json-iterator/go-1.1.12
Bump github.com/json-iterator/go from 1.1.11 to 1.1.12
2021-09-13 14:51:29 -04:00
f07a2bfbec Merge pull request #11440 from ashley-cui/ssh
Use default username for podman machine ssh
2021-09-13 14:34:29 -04:00
8fa3e6c58e Merge pull request #11552 from Luap99/common
bump c/common to v0.44.0
2021-09-13 14:18:51 -04:00
ba2130ff55 If container exits with 125 podman should exit with 125
fixes: https://github.com/containers/podman/issues/11540

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-13 14:04:01 -04:00
cc94914474 Merge pull request #11550 from atykhyy/patch-2
Fix #11444: remote breaks with stdout redirection
2021-09-13 14:02:53 -04:00
9ae947654f Bump github.com/json-iterator/go from 1.1.11 to 1.1.12
Bumps [github.com/json-iterator/go](https://github.com/json-iterator/go) from 1.1.11 to 1.1.12.
- [Release notes](https://github.com/json-iterator/go/releases)
- [Commits](https://github.com/json-iterator/go/compare/v1.1.11...v1.1.12)

---
updated-dependencies:
- dependency-name: github.com/json-iterator/go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 17:25:11 +00:00
73422de08d Merge pull request #11548 from containers/dependabot/go_modules/github.com/containers/storage-1.36.0
Bump github.com/containers/storage from 1.35.0 to 1.36.0
2021-09-13 13:07:52 -04:00
b0cbcd1d09 bump c/common to v0.44.0
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-13 18:49:38 +02:00
125f90c54a Merge pull request #11537 from TomSweeneyRedHat/dev/tsweeney/fixhyphen
[CI:DOCS] Remove short 'a' option from all-tags
2021-09-13 11:33:51 -04:00
32424d9a9b remove rootlessport socket to prevent EADDRINUSE
When we restart a container via podman restart or restart policy the
rootlessport process fails with `address already in use` because the
socketfile still exists.
This is a regression and was introduced in commit abdedc31a25e.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-13 16:45:55 +02:00
c23f81fab6 Fix #11444: remote breaks with stdout redirection
`setConsoleMode` should do nothing if the handle is not a terminal. The proposed change is [exactly what `golang.org/x/term/IsTerminal()` does on Windows](https://cs.opensource.google/go/x/term/+/6886f2df:term_windows.go).

[NO TESTS NEEDED]

Signed-off-by: Anton Tykhyy <atykhyy@gmail.com>
2021-09-13 17:42:48 +03:00
a8875faca1 [CI:DOCS] Remove short 'a' option from all-tags
The short option 'a' for the --all-tags option in the pull
page is not valid, remove it.

Addresses: #11536

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2021-09-13 09:27:57 -04:00
eec59cea2c Bump github.com/containers/storage from 1.35.0 to 1.36.0
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.35.0 to 1.36.0.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/main/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.35.0...v1.36.0)

---
updated-dependencies:
- dependency-name: github.com/containers/storage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 12:29:39 +00:00
0f3d3bd21d Merge pull request #11505 from cevich/enable_rootless_unit
Cirrus: Run unit-tests rootless
2021-09-12 06:40:36 -04:00
f785d8d194 Merge pull request #11517 from jwhonce/issues/10053
Refactor API server emphasis on logging
2021-09-12 02:07:36 -04:00
72662f790b Merge pull request #11525 from rhatdan/healthcheck
Stop outputting 'healthy' on healthcheck
2021-09-11 18:09:36 -04:00
ec3037062d Merge pull request #11513 from Luap99/unshare
podman unshare keep exit code
2021-09-11 17:26:35 -04:00
0501258b73 Merge pull request #11524 from containers/dependabot/go_modules/github.com/opencontainers/selinux-1.8.5
Bump github.com/opencontainers/selinux from 1.8.4 to 1.8.5
2021-09-11 04:56:18 -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
5e9758fd5f Merge pull request #11323 from umohnani8/init
Add init containers to generate and play kube
2021-09-10 13:44:47 -04:00
4fbc5b8fe7 Stop outputting 'healthy' on healthcheck
We should only print unhealthy if the check fails.  Currently this is
filling logs when users are running lots of healthchecks.

Improves: https://github.com/containers/podman/issues/11157

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-10 11:20:01 -04:00
81751bebc6 Bump github.com/opencontainers/selinux from 1.8.4 to 1.8.5
Bumps [github.com/opencontainers/selinux](https://github.com/opencontainers/selinux) from 1.8.4 to 1.8.5.
- [Release notes](https://github.com/opencontainers/selinux/releases)
- [Commits](https://github.com/opencontainers/selinux/compare/v1.8.4...v1.8.5)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/selinux
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-10 15:18:53 +00:00
e6046224ea Merge pull request #11498 from vrothberg/fix-11489
[CI:DOCS] podman machine: enforce a single search registry
2021-09-10 11:02:51 -04:00
923648b487 Merge pull request #11509 from containers/dependabot/go_modules/github.com/containers/psgo-1.6.0
Bump github.com/containers/psgo from 1.5.2 to 1.6.0
2021-09-10 11:00:51 -04:00
f3c0d707f0 Merge pull request #11519 from tnk4on/fix-missing-args-in-example
[CI:DOCS] Fix missing args `NAME` in examples
2021-09-10 10:59:49 -04:00
0b6c56b80d Merge pull request #11506 from giuseppe/fix-stats-restart-container
stats: detect container restart and allow paused containers
2021-09-10 10:53:47 -04:00
cf4a7b8d37 Merge pull request #11516 from jelly/swagger/containerstats
[CI:DOCS] Add response to /libpod/containers/stats documentation
2021-09-10 10:52:48 -04:00
f5e4ffb5e4 Add init containers to generate and play kube
Kubernetes has a concept of init containers that run and exit before
the regular containers in a pod are started. We added init containers
to podman pods as well. This patch adds support for generating init
containers in the kube yaml when a pod we are converting had init
containers. When playing a kube yaml, it detects an init container
and creates such a container in podman accordingly.
Note, only init containers created with the init type set to "always"
will be generated as the "once" option deletes the init container after
it has run and exited. Play kube will always creates init containers
with the "always" init container type.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-09-10 09:37:46 -04:00
d2e10a71d6 podman unshare keep exit code
In case the command inside the podman unshare env failed podman unshare
always exits with 125 and prints `Error: exit status 125`. This is a
bad user experience and makes it difficult to use in scripts which could
expect certain exit codes.
This commit makes sure podman unshare uses the same exit code as the
command and does not print the useless `exit status X` message.

Also to match podman run/exec it should return 126 for EPERM
and 127 for ENOENT.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-10 15:30:25 +02:00
309d989712 Bump github.com/containers/psgo from 1.5.2 to 1.6.0
Bumps [github.com/containers/psgo](https://github.com/containers/psgo) from 1.5.2 to 1.6.0.
- [Release notes](https://github.com/containers/psgo/releases)
- [Commits](https://github.com/containers/psgo/compare/v1.5.2...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/containers/psgo
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

[NO TESTS NEEDED] since it's migrating to a new version.

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-10 15:23:43 +02:00
580ac4c6ab Merge pull request #11523 from Luap99/e2e-warning
try to create the runroot before we warn that it is not writable
2021-09-10 09:15:46 -04:00
f87f27ddc8 Add /containers/stats response to API docs
Include the response schema for a succesful request in the
/containers/stats API documentation

Additionally remove http 409 from /libpod/containers/stats docs, the
documentation was copied from the deprecated stats endpoint, when a
container is unavailabe the endpoint returns an empty list and no 409.

Signed-off-by: Jelle van der Waa <jvanderwaa@redhat.com>
2021-09-10 15:15:35 +02:00
8d638d502b try to create the runroot before we warn that it is not writable
The rootless integration tests show the XDG_RUNTIME_DIR warning without
any reasons. Podman runs without problems in these and yet the warning
is shown. I think the problem is that we check the permission before we
create the runroot directory.

[NO TESTS NEEDED]

Fixes #11521

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-10 13:23:52 +02:00
5bf2201447 machine: set filemodes in octal
By popular request, turn decimals to octal.  Most eyes are trained to
parse file permissions in octal.

[NO TESTS NEEDED] since machine isn't tested yet.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-10 12:50:28 +02:00
6f36a47ac2 podman machine: enforce a single search registry
Enforce "docker.io" to be the only search registry.  Short-name
resolution for remote clients is not fully supported since there is no
means to prompt.  Enforcing a single registry  works around the problem
since prompting only fires with more than one search registry.

Fixes: #11489
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-10 12:43:07 +02:00
50688da29b stats: detect containers restart
if the current cpu usage time is lower than what previously recorded,
then it means the container was restarted and now it runs in a new
cgroup.  When this happens, reset the prevStats.

Closes: https://github.com/containers/podman/issues/11469

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-09-10 09:03:10 +02:00
2b85382ca1 api: correctly set the container stats
override the outer scope variable instead of creating a local one.
Otherwise the wrong variable would be used for the next iterations.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-09-10 09:03:09 +02:00
53dc99fa60 stats: allow to read stats for paused containers
paused containers still a cgroup we can use to grab the stats.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-09-10 09:03:08 +02:00
a4cc32c2c5 Fix missing args in name in example
Signed-off-by: Shion Tanaka <shtanaka@redhat.com>
2021-09-10 15:50:02 +09:00