16818 Commits

Author SHA1 Message Date
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
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
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
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
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
ab2f3cf54d Merge pull request #16029 from andrei-n-cosma/kube-default-network
Add pods created by play kube to a default network
2022-10-05 16:08:37 +02:00
e136376d1f Clean up when stopping pods
We have a test to verify that init containers in pods are
deleted when the `--init-ctr=once` option is specified. The test
creates two containers, one of them an init container, starts the
pod, stops the pod, and restarts the pod, checking for the
presence of a file created by the init container during the
second start. We're seeing a race where the file still exists,
which I'm fairly certain comes down to the SHM mount not being
cleaned up after the pod is stopped.

Fortunately, we already have code to do this - just flip the bool
that controls cleanup from false to true.

[NO NEW TESTS NEEDED] Fixes a difficult to reproduce race
condition.

Fixes #16046

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-10-05 09:21:16 -04:00
3451aac35e Man pages: refactor common options: --pod
Only between podman-create and -run; the other meanings
of --pod are too different. This almost didn't feel worth
refactoring, except the podman-run version fixed a word
and added a possibly important note about infra containers.
I went with the podman-run version.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-10-05 04:27:47 -06:00
84c85f4d94 Merge pull request #16049 from edsantiago/docs_dedup_features
[CI:DOCS] Man pages: refactor common options: --features
2022-10-05 12:24:24 +02:00
6cf34000b9 Merge pull request #16050 from baude/bz2131836
Prevent nil pointer deref in GetImage
2022-10-05 02:51:48 +02:00
aaa9f4ea90 Prevent nil pointer deref in GetImage
Trying to print the image id on a failed inspect will result in a nil
pointer panic because the image will be nil.  Replace image.id with the
image name which is defined as a string without the use of inspect.

Fixes: bz#2131836

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-10-04 15:31:00 -05:00
f250560a80 Add pods created by kube play to a default network
In order to allow pods to reach other pods (as in Kubernetes) they all
need to be added to the same network. A network is created (if it
doesn't exist) and pods created by play-kube are added to that network.
When network options are passed to kube command the pods are not
attached to the default kube network.

Signed-off-by: Andrei Natanael Cosma <andrei@intersect.ro>
2022-10-04 21:59:57 +02:00
26468c2274 Man pages: refactor common options: --features
Easy one: text was already identical between both files.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-10-04 11:14:53 -06:00
0330d1abed Merge pull request #16032 from edsantiago/docs_dedup_variant
[CI:DOCS] Man pages: refactor common options: --variant
2022-10-04 19:08:25 +02:00
ad2ae8e574 Merge pull request #16045 from containers/dependabot/go_modules/github.com/opencontainers/image-spec-1.1.0-rc2
build(deps): bump github.com/opencontainers/image-spec from 1.1.0-rc1 to 1.1.0-rc2
2022-10-04 16:09:06 +02:00
2f6c911d62 build(deps): bump github.com/opencontainers/image-spec
Bumps [github.com/opencontainers/image-spec](https://github.com/opencontainers/image-spec) from 1.1.0-rc1 to 1.1.0-rc2.
- [Release notes](https://github.com/opencontainers/image-spec/releases)
- [Changelog](https://github.com/opencontainers/image-spec/blob/main/RELEASES.md)
- [Commits](https://github.com/opencontainers/image-spec/compare/v1.1.0-rc1...v1.1.0-rc2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-04 12:17:51 +00:00