16829 Commits

Author SHA1 Message Date
c1d832d88b Merge pull request #16118 from vrothberg/proxy-mcproxface
play kube: notifyproxy: listen before starting the pod
2022-10-12 16:13:35 -04:00
a344928c01 Merge pull request #16127 from containers/dependabot/go_modules/golang.org/x/text-0.3.8
build(deps): bump golang.org/x/text from 0.3.7 to 0.3.8
2022-10-12 10:57:38 -04:00
b13939bb6f Merge pull request #16123 from alexlarsson/less-json-dup
Avoid unnecessary calls to Container.Config() and Container.Spec()
2022-10-12 10:45:47 -04:00
6e6280d233 Merge pull request #16071 from edsantiago/docs_dedup_os_version
[CI:DOCS] Man pages: refactor common options: --os-version
2022-10-12 10:39:52 -04:00
065cc94799 Merge pull request #16109 from SoMuchForSubtlety/play-kube-binary-data
play kube: add support for configmap binaryData
2022-10-12 10:31:47 -04:00
14d459cf9f Merge pull request #16126 from containers/dependabot/go_modules/github.com/onsi/gomega-1.22.1
build(deps): bump github.com/onsi/gomega from 1.20.2 to 1.22.1
2022-10-12 10:25:43 -04:00
695a848968 Merge pull request #16078 from rhatdan/main
Revert "cmd/podman: add support for checkpoint images"
2022-10-12 10:12:41 -04:00
2a9df07f52 Merge pull request #16129 from edsantiago/fix-16075
system tests: health-on-failure: fix broken logic
2022-10-12 10:01:01 -04:00
f16e9acc64 system tests: health-on-failure: fix broken logic
Basically, in the timeout loop where we checked for new CID
on the restarted container, we were running 'podman inspect'
(not 'inspect --format ID'), and comparing full hundred-line
output against single-line CID string.

While I'm in here, add 'c_' prefix to container to make it
easier for my old eyes to recognize "oh, that's a container name"
vs "is that a name? a SHA? a woozle?"

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-10-12 06:29:59 -06:00
7ff8c8f796 build(deps): bump golang.org/x/text from 0.3.7 to 0.3.8
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.3.8.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.7...v0.3.8)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-12 12:10:32 +00:00
00adeda804 build(deps): bump github.com/onsi/gomega from 1.20.2 to 1.22.1
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.20.2 to 1.22.1.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.20.2...v1.22.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-12 12:10:17 +00:00
d08b4c1339 ContainerEngine.SetupRootless(): Avoid calling container.Config()
This is a very expensive call as it deep duplicates the Config, and
we just need to read a single member, so use ConfigNoCopy() instead.

[NO NEW TESTS NEEDED] Just minor performance effects

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-12 13:45:49 +02:00
03c5f9d02f Container filters: Avoid use of ctr.Config()
This is a very expensive function as it does a deep copy. Instead
use pre-existing accessors like ctr.CreatedTime() where they exist
and ctr.ConfigNoCopy() where not.

[NO NEW TESTS NEEDED] Just minor performance effects

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-12 13:45:49 +02:00
af38c79e36 Avoid unnecessary calls to Container.Spec()
This call does a deep copy, which is only needed if you want
to modify the return value. Instead we use ctr.ConfigNoCopy().Spec
which is just a pointer dereference.

[NO NEW TESTS NEEDED] Just minor performance effects

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-12 13:45:49 +02:00
55191ecc20 Add and use Container.LinuxResource() helper
This gets c.config.Spec.Linux.Resources, with some nil checks.
Using this means less open coding of the nil-checks, but also the
existing user of this field in moveConmonToCgroupAndSignal() was
using ctr.Spec().Linux.Resources instead, and the Spec() call
is very expensive.

[NO NEW TESTS NEEDED] Just minor performance effects

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-12 13:45:49 +02:00
1db0735068 Merge pull request #16099 from na0x2c6/update-docs-for-podman-machine
[CI:DOCS] Man pages: Add mention of behavior due to XDG_CONFIG_HOME
2022-10-12 07:35:46 -04:00
7b84a3a434 play kube: notifyproxy: listen before starting the pod
Starting listening for the READY messages on the sdnotify proxies before
starting the Pod.  Otherwise, we may be missing messages.

[NO NEW TESTS NEEDED] as it's hard to test this very narrow race.

Related to but may not be fixing #16076.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-12 11:36:04 +02:00
e5ace19aa2 Merge pull request #16117 from alexlarsson/container-terminal-helper
Add and use libpod/Container.Terminal() helper
2022-10-11 16:18:02 -04:00
2bee2216ce play kube: add support for configmap binaryData
Signed-off-by: Jakob Ahrer <jakob@ahrer.dev>
2022-10-11 18:05:12 +02:00
1038f063e0 Add and use libpod/Container.Terminal() helper
This just gets ctr.config.Spec.Process.Terminal with some null checks,
allowing several places that open-coded this to use the helper.

In particular, this helps the code in
pkg/domain/infra/abi/terminal.StartAttachCtr(), that used to do:
`ctr.Spec().Process.Terminal`, which looks fine, but actually causes
a deep json copy in the `ctr.Spec()` call that takes over 3 msec.

[NO NEW TESTS NEEDED] Just minor performance effects

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-11 17:17:11 +02:00
619366de93 Merge pull request #16088 from alexlarsson/wait-on-conmon-without-sleep
Avoid unnecessary timeout of 250msec when waiting on container shutdown
2022-10-11 10:17:11 -04:00
406616ddc1 Merge pull request #16111 from vrothberg/healthcheck-fixes
healthcheck: fix --on-failure=stop
2022-10-11 10:06:05 -04:00
b47b48fd03 Revert "Add checkpoint image tests"
This reverts commit bbe1063a5ae681ad04a049518c6087421b919f2e.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-10-11 10:04:55 -04:00
f437078d2b Revert "cmd/podman: add support for checkpoint images"
This reverts commit 9c3d8bb494f358ecff785ba81a58f2e05f1a98a1.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-10-11 07:55:16 -04:00
4dd67272ed healthcheck: fix --on-failure=stop
Fix the "stop" on-failure action by not removing the transient systemd
timer and service during container stop.  Removing the service will
in turn cause systemd to terminate the Podman process attempting to
stop the container and hence leave it in the "stopping" state.

Instead move the removal into the restart sequence.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-11 13:01:07 +02:00
bb0b1849d7 Merge pull request #16083 from dfr/freebsd-pod
Add support for 'podman pod' on FreeBSD
2022-10-10 15:30:01 +02:00
d4052c1aa9 Man pages: Add mention of behavior due to XDG_CONFIG_HOME
When the `XDG_CONFIG_HOME` environment variable is changed, for example,
to switch development contexts, the behavior of the podman-machine can
be confusing. The documentation had not mentioned this, and this commit
adds these mentions.

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

Reviewed-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Naoaki Ueda <nao@uedder.com>
2022-10-10 22:24:09 +09:00
c34b5be990 Avoid unnecessary timeout of 250msec when waiting on container shutdown
When you run "podman run foo" we attach to the container, which essentially
blocks until the container process exits. When that happens podman immediately
calls Container.WaitForExit(), but at this point the exit value has not
yet been written to the db by conmon. This means that we almost always
hit the "check for exit state; sleep 250msec" loop in WaitForExit(),
delaying the exit of podman run by 250 msec.

More recent kernels (>= 5.3) supports the pidfd_open() syscall, that
lets you open a fd representing a pid and then poll on it to wait
until the process exits. We can use this to have the first sleep
be exactly as long as is needed for conmon to exit (if we know its pid).
If for whatever reason there is still issues we use the old sleep loop
on later iterations.

This makes "time podman run fedora true" about 200msec faster.

[NO NEW TESTS NEEDED]

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-10 11:43:02 +02:00
5908996738 Merge pull request #16084 from vrothberg/health-check-fix
health checks: make on-failure action retry aware
2022-10-07 19:27:42 +02:00
02040089a6 health checks: make on-failure action retry aware
Make sure that the on-failure actions only kick in once the health check
has passed its retries.  Also fix race conditions on reading/writing the
log.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-07 15:43:48 +02:00
2062ab9db4 Merge pull request #16072 from alexlarsson/events-shutdown-nosleep
libpod: Remove 100msec delay during shutdown
2022-10-07 13:16:56 +02:00
5b71070e42 libpod: Remove 100msec delay during shutdown
When shutting down the image engine we always wait for the image
even goroutine to finish writing any outstanding events. However,
the loop for that always waits 100msec every iteration. This means
that (depending on the phase) shutdown is always delayed up to 100msec.

This is delaying "podman run" extra much because podman is run twice
(once for the run and once as cleanup via a conmon callback).

Changing the image loop to exit immediately when a libimageEventsShutdown
(but first checking for any outstanding events to write) improves podman
run times by about 100msec on average.

Note: We can't just block on the event loop reading the shutdown event
anymore, we need to wait until it read and processed any outstanding
events, so we now send the shutdown event and then block waiting for the
channel to be closed by the event loop.

[NO NEW TESTS NEEDED]

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-07 10:13:26 +02:00
b4b7011392 libpod: Add support for 'podman pod' on FreeBSD
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-10-07 08:27:27 +01:00
7f8964a78f libpod: Factor out cgroup validation from (*Runtime).NewPod
This moves the code to runtime_pod_linux.go since cgroups are
platform-specific.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-10-07 08:27:27 +01:00
d71160539d libpod: Move runtime_pod_linux.go to runtime_pod_common.go
Most of the code can be shared with other unix-like platforms.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-10-07 08:27:08 +01:00
c35a70d211 specgen/generate: Avoid a nil dereference in MakePod
The value of p.PodSpecGen.InfraContainerSpec.ResourceLimits can be nil
on FreeBSD.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-10-07 08:26:10 +01:00
e187b9711d libpod: Factor out cgroups handling from (*Pod).refresh
This moves the cgroup code to pod_internal_linux.go and adds a no-op
stub for FreeBSD.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-10-07 08:26:10 +01:00
d33a31524a Merge pull request #16057 from mheon/fix_16046
Clean up when stopping pods
2022-10-07 00:48:11 +02:00
36558828ae Merge pull request #16073 from iamkirkbater/osx-contrib-linkback
[CI:DOCS] MacOS contributing docs link
2022-10-06 21:34:36 +02:00
ab3d3f818d Merge pull request #16067 from tyler92/fix-directory-or-create
Create a full path to a directory when DirectoryOrCreate is used
2022-10-06 19:43:47 +02:00
713428df0b Adds a link to OSX docs in CONTRIBUTING.md
This adds a small bit of text so that new OSX devs can more easily find
the MacOS specific contributing guidelines.

Signed-off-by: Kirk Bater <kirk.bater@gmail.com>
2022-10-06 13:28:32 -04:00
eb85012064 Merge pull request #16070 from boaz0/fix_system_service_uri
Return error in podman system service if URI scheme is not unix/tcp
2022-10-06 18:34:47 +02:00
f8b659d095 Man pages: refactor common options: --os-version
Only between the two podman-manifest-* commands. podman-build
is too different.

Easy one, text was already identical

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-10-06 08:37:48 -06:00
8b189c0a06 Create full path to a directory when DirectoryOrCreate is used with play kube
Signed-off-by: Mikhail Khachayants <tyler92@inbox.ru>
2022-10-06 15:37:36 +03:00
d4f622da7d Return error in podman system service if URI scheme is not unix/tcp
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2022-10-06 14:47:03 +03:00
13a1c55d3f Merge pull request #16034 from rhatdan/VENDOR
Update vendor of containers/buildah v1.28.0
2022-10-06 04:31:13 +02:00
94cfe7b7da Merge pull request #15910 from edsantiago/cron_treadmill
Proof of concept: nightly dependency treadmill
2022-10-06 04:28:12 +02:00
fce7a4f358 Merge pull request #16061 from edsantiago/docs_dedup_time
[CI:DOCS] Man pages: refactor common options: --time
2022-10-06 04:25:23 +02:00
51c3578415 Man pages: refactor common options: --time
Only in container/pod stop/rm/restart man pages; the others
(volume-rm, network-rm, system-service) are too different to refactor.

Mostly an easy one, no manual reconciliation needed apart from
the pod-vs-container difference.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-10-05 09:59:01 -06:00
cc609e52bd Merge pull request #16055 from edsantiago/docs_dedup_pod
[CI:DOCS] Man pages: refactor common options: --pod
2022-10-05 16:13:48 +02:00