16078 Commits

Author SHA1 Message Date
f0e8904e0d Merge pull request #14755 from cdoern/system
fix volume reporting in system df
2022-06-28 19:14:00 +00:00
60c9aeabab Merge pull request #14717 from ZeyadYasser/fix-restore-runtime-check
Fix runtime check during restore
2022-06-28 19:07:52 +00:00
d8f197cc14 Merge pull request #14400 from cdoern/scp
podman image scp remote support & podman image scp tagging
2022-06-28 17:46:12 +00:00
59a7ac210b Make podman machine stop wait for qemu to exit
- New `VMPidFilePath` field in MachineVM config holds the path for the
  qemu PID file

- qemu is now started with the `-pidfile` argument set to `VMPidFilePath`

- Machines created before this won't have the VM PID file configured,
  stopping these VMs will revert back to waiting on the state to change
  away from `Running`, plus an added 2s sleep to give time for the VM to
  exit and to avoid potential issues

- Machines created after this will have a VM PID file configured and
  stopping the machine will wait indefinitely for the VM to exit

[NO NEW TESTS NEEDED]

Signed-off-by: Shane Smith <shane.smith@shopify.com>
2022-06-28 13:28:38 -04:00
2ee9fe4cbd vendor containers/common
Pull in fixes for platform checks to silence annoying warnings when
pulling images by platforms using uname values.

Fixes: #14669
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-06-28 17:12:56 +02:00
79a38a2c6a Add test for restore runtime verification using non-default runtime
Runtime verification test for container checkpoint with export
used the default runtime for test which causes test to always
pass. Problem rises when using non-default runtime, then doing
a restore. This test forcse using a non-default runtime during
container creation.

Edge case:
	1. Default runtime is crun
	2. Container is created with runc
	3. Checkpoint without setting --runtime into archive
	4. Restore without setting --runtime from archive

It should be expected that podman identifies runtime from the
checkpoint archive.

Signed-off-by: Zeyad Yasser <zeyady98@gmail.com>
2022-06-28 16:14:47 +02:00
8e3a46a87b Fix runtime check during restore
cfg.RuntimePath was set to default runtime, so the empty string
check fails. Instead we could check if the flag was changed.

Signed-off-by: Zeyad Yasser <zeyady98@gmail.com>
2022-06-28 16:14:38 +02:00
6c4c050d3d fix volume reporting in system df
currently, podman system df incorrectly calculates the reclaimable storage for
volumes, using a cumulative reclaimable variable that is incremented and placed into each
report entry causing values to rise above 100%.

Switch this variables to be in the context of the loop, so it resets per volume just like the size variable does.

resolves #13516

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-06-28 10:09:38 -04:00
50fa651a4e Merge pull request #14700 from shuttle-hq/bug/docker-compat-initialized
Docker compat returning unknown "initialized" for `status.status`
2022-06-28 14:07:04 +00:00
8267cd3c51 Merge pull request #14734 from giuseppe/copyup-switch-order
volume: add two new options copy and nocopy
2022-06-28 13:57:16 +00:00
cc49146332 Docker compat returning unknown "initialized" for status.status
Some background for this PR is in discussion #14641. In short, ever so often a container inspect will return a `status.status` of `initialized` from the Docker compat socket.

From the discussion I found these lines which tries to fix a "configured" status to "created".
c936d1e611/pkg/api/handlers/compat/containers.go (L291-L294)

However, commit 141de8686289 (Revamp Libpod state strings for Docker compat) removed the "configured" return value from the `String()` method called on line 291 above. Thus, making the `if` check redundant as it will never hit. But the same commit also introduces a return for "initialized" which this `if` should probably have been adapted for.

Signed-off-by: Pieter Engelbrecht <pieter@shuttle.rs>
2022-06-28 15:50:45 +02:00
9c5d97b5c5 Merge pull request #14751 from dfr/freebsd-make
FreeBSD build support
2022-06-28 13:15:12 +00:00
6d3520e8b7 podman image scp remote support & podman image scp tagging
add support for podman-remote image scp as well as direct access via the API. This entailed
a full rework of the layering of image scp functions as well as the usual API plugging and type creation

also, implemented podman image scp tagging. which makes the syntax much more readable and allows users t tag the new image
they are loading to the local/remote machine:

allow users to pass a "new name" for the image they are transferring
`podman tag` as implemented creates a new image im `image list` when tagging, so this does the same
meaning that when transferring images with tags, podman on the remote machine/user will load two images
ex: `podman image scp computer1::alpine computer2::foobar` creates alpine:latest and localhost/foobar on the remote host

implementing tags means removal of the flexible syntax. In the currently released podman image scp, the user can either specify
`podman image scp source::img dest::` or `podman image scp dest:: source::img`. However, with tags this task becomes really hard to check
which is the image (src) and which is the new tag (dst). Removal of that streamlines the arg parsing process

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-06-28 08:54:19 -04:00
c66a489b75 Merge pull request #14741 from giuseppe/pod-ps-no-race
pod: ps does not race with rm
2022-06-28 11:41:47 +00:00
dc58a73064 Makefile: don't try to build rootlessport on FreeBSD
Rootless containers are not possible on FreeBSD. While I would like to
close that gap, getting the necessary changes into the FreeBSD kernel
is a long term project so until then, this removes the rootlessport
helper from the build on FreeBSD.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-06-28 10:29:50 +01:00
c55feb7bfb Makefile: don't use '-t' to specify the directory to install manpages
This option doesn't exist on freebsd or macos' install utility. In this
case, we can use the 'install file1 file2 ... dir' pattern which is
supported by all implementations of install that I'm aware of. The
makefile rule already creates the target directory so there is no
ambiguity.

No new tests are needed here since the same files are being installed
in the same places.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-06-28 10:29:50 +01:00
af16edf499 Makefile: use GNU sed to convert manpages on FreeBSD
The sed implementation on FreeBSD has a strict interpretation of posix
'basic' regular expressions. It would be better to re-implement this
using 'extended' regular expressions but for now, just use GNU sed.

This should have no functional difference on currently supported
platforms.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-06-28 10:29:50 +01:00
94a634fcfe Makefile: use bash to evaluate tool paths
The makefile uses the pattern $(shell command -v path1 path2 ...) to
deduce pathnames for various executables. On FreeBSD, the default shell
does have a 'command' builtin which supports the '-v' option but only
allows a single path as argument. Rather than work around this limitation
with alternatives like for, just set bash as the default shell. We
already require bash to be installed for various helper scripts.

This change only affects FreeBSD so no new tests are needed.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-06-28 10:29:50 +01:00
0e03a64f99 pod: ps does not race with rm
the "pod ps" command first retrieves the list of all pods, then
iterates over the list to inspect each pod.  This introduce a race
since a pod could be deleted in the meanwhile by another process.

Solve it by ignoring the define.ErrNoSuchPod error.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-06-28 10:38:12 +02:00
0cabd8006b pods: move code to a new function
it is a preparatory change for the next commit.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-06-28 10:38:12 +02:00
a575098975 Merge pull request #14742 from rhatdan/machine
Show starting state when machine is starting
2022-06-28 06:57:57 +00:00
d095053b9c Merge pull request #14597 from containers/closes_14583
Use Regexp in volume ls --filter name
2022-06-28 00:32:58 +00:00
3b10c1b78a Use Regexp in volume ls --filter name
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2022-06-27 21:34:39 +03:00
aada13f244 volume: new options [no]copy
add two new options to the volume create command: copy and nocopy.

When nocopy is specified, the files from the container image are not
copied up to the volume.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-06-27 20:22:20 +02:00
a4094530bc volume: drop TODO comment
the two operations are equivalent since securejoin.SecureJoin() has
solved the symlinks.  Prefer the Lstat version though to make sure
symlinks are never resolved and we do not end up using a path on the
host.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-06-27 20:22:20 +02:00
443a2afdb5 volumes: switch order of checks
avoid any I/O operation on the volume if the source directory is empty.

This is useful on network file systems (since CAP_DAC_OVERRIDE is not
honored) where the root user might not have enough privileges to
perform an I/O operation on the NFS mount but the user running inside
the container has.

[NO NEW TESTS NEEDED] it needs a setup with a network file system

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-06-27 20:22:20 +02:00
28e2a604b4 vendor: update containers/common
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-06-27 20:22:20 +02:00
9c4b8a29b0 Merge pull request #14713 from Luap99/volume-plugin
add podman volume reload to sync volume plugins
2022-06-27 17:55:19 +00:00
278afae1de Merge pull request #14705 from jakecorrenti/show-health-status-event
Show Health Status events
2022-06-27 17:49:27 +00:00
ed2afb2059 Merge pull request #14732 from dfr/criu
Add missing criu symbols to criu_unsupported.go
2022-06-27 17:47:06 +00:00
99f68898c0 reveal machine error, ignore false state
This PR covers two edge cases discovered by fiddling with machine
manually.  It is possible (like after a manual cleanup of a machine)
that a leftover qemu socket file can indicate the prescense of a machine
running.

Also, reveal the error of a Exec.Command by wrapping the generic error
around what was in stderr.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-06-27 12:40:15 -05:00
c29c6adf96 Merge pull request #14744 from giuseppe/fix-go-sum
go.sum: run make vendor
2022-06-27 16:54:49 +00:00
9cb93c6f90 go.sum: run make vendor
The CI is currently broken.  Update go.sum.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-06-27 18:16:00 +02:00
465c54829e Merge pull request #14733 from dfr/unix-signal
Implement CatchAll and StopCatch in signal_unix.go
2022-06-27 15:58:34 +00:00
088665d2cf Merge pull request #14654 from cdoern/cgroup
podman cgroup enhancement
2022-06-27 15:14:20 +00:00
0c1a3b70f5 Show Health Status events
Previously, health status events were not being generated at all. Both
the API and `podman events` will generate health_status events.

```
{"status":"health_status","id":"ae498ac3aa6c63db8b69a37583a6eae1a9cefbdbdbeeadcf8e1d66d745f0df63","from":"localhost/healthcheck-demo:latest","Type":"container","Action":"health_status","Actor":{"ID":"ae498ac3aa6c63db8b69a37583a6eae1a9cefbdbdbeeadcf8e1d66d745f0df63","Attributes":{"containerExitCode":"0","image":"localhost/healthcheck-demo:latest","io.buildah.version":"1.26.1","maintainer":"NGINX Docker Maintainers \u003cdocker-maint@nginx.com\u003e","name":"healthcheck-demo"}},"scope":"local","time":1656082205,"timeNano":1656082205882271276,"HealthStatus":"healthy"}
```
```
2022-06-24 11:06:04.886238493 -0400 EDT container health_status ae498ac3aa6c63db8b69a37583a6eae1a9cefbdbdbeeadcf8e1d66d745f0df63 (image=localhost/healthcheck-demo:latest, name=healthcheck-demo, health_status=healthy, io.buildah.version=1.26.1, maintainer=NGINX Docker Maintainers <docker-maint@nginx.com>)
```

Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
2022-06-27 10:44:53 -04:00
8806606ca2 Merge pull request #14725 from Luap99/port-range-flake
Fix "podman run port forward range" flake
2022-06-27 13:42:58 +00:00
386ea49cf5 Show starting state when machine is starting
Currently podman machine list never shows the starting state.

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

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-06-27 09:27:46 -04:00
1022ea36dd Merge pull request #14687 from cdoern/vols
podman run/create -v relative filepath support
2022-06-27 12:35:10 +00:00
cc86315455 Merge pull request #14695 from boaz0/closes_14682
Fix machine list: --format implies --noheading
2022-06-27 12:30:11 +00:00
157a966ae8 Merge pull request #14665 from Luap99/machine-now
podman machine init --now: respect proxy envs
2022-06-27 12:27:28 +00:00
66c62eb968 Implement CatchAll and StopCatch in signal_common.go
This is part of a set of changes to port podman to the FreeBSD platform.
The pkg/signal parts are needed to enable ABI mode on FreeBSD. No tests
are needed here because it should be a functional no-op for linux.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-06-27 13:27:12 +01:00
345778ece0 Fix "podman run port forward range" flake
The test must ensure that all ports in the range are free not just
the first. This flakes often because port 5355 is always in use by
systemd-resolved on fedora.

Fixes #14716

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-06-27 14:25:24 +02:00
c8cb7a2b99 Merge pull request #14724 from containers/dependabot/go_modules/github.com/stretchr/testify-1.7.5
Bump github.com/stretchr/testify from 1.7.4 to 1.7.5
2022-06-27 12:20:51 +00:00
4c5788bac6 Fix spelling of GetCriuVersion
Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-06-27 12:57:44 +01:00
5902905970 Add missing criu symbols to criu_unsupported.go
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-06-27 12:57:44 +01:00
3176b3fe01 Merge pull request #14685 from mheon/gitlab
Followon to #14559
2022-06-27 10:58:10 +00:00
324435a648 Merge pull request #14703 from cdoern/connection
fix system connection and scp testing
2022-06-25 13:07:13 +00:00
2792e598c7 podman cgroup enhancement
currently, setting any sort of resource limit in a pod does nothing. With the newly refactored creation process in c/common, podman ca now set resources at a pod level
meaning that resource related flags can now be exposed to podman pod create.

cgroupfs and systemd are both supported with varying completion. cgroupfs is a much simpler process and one that is virtually complete for all resource types, the flags now just need to be added. systemd on the other hand
has to be handeled via the dbus api meaning that the limits need to be passed as recognized properties to systemd. The properties added so far are the ones that podman pod create supports as well as `cpuset-mems` as this will
be the next flag I work on.

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-06-24 15:39:15 -04:00
95707a08bf Merge pull request #14726 from cevich/podmanimage_docs
[CI:DOCS] Minor update to podmanimage upstream docs
2022-06-24 16:08:12 +00:00