15940 Commits

Author SHA1 Message Date
914835d3e4 Merge pull request #14813 from eriksjolund/add_troubleshooting_tip_about_carriage_return
[CI:DOCS] troubleshooting: document --tty and CR
2022-07-05 11:07:31 +00:00
b9aa475555 Sync: handle exit file
Make sure `Sync()` handles state transitions and exit codes correctly.
The function was only being called when batching which could render
containers in an unusable state when running concurrently with other
state-altering functions/commands since the state must be re-read from
the database before acting upon it.

Fixes: #14761
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-05 12:32:02 +02:00
49cb288df3 hack/test/utils: switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.

[NO NEW TESTS NEEDED]

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-05 12:13:33 +02:00
ffc8d65492 Merge pull request #14827 from flouthoc/specgen-run-support-manifest
specgen,run: support running container from valid manifest list using `--platform`
2022-07-05 10:10:41 +00:00
2da731a7ea test: reduce sleep interval
there is no need to use such long sleep intervals for such cheap
operations like opening a connection or stat'ing a file.

Also make WaitForService() honor defaultWaitTimeout.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-05 11:36:06 +02:00
c02f793bab test: return immediately on connect
if the connection is successfull then return immediately instead of doing
all the iterations.  It also solves a problem where connections are
leaked since there are multiple Dial but only one Close.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-05 11:12:30 +02:00
773eead54e Merge pull request #14789 from saschagrunert/libpod-errors
libpod/runtime: switch to golang native error wrapping
2022-07-05 07:23:22 +00:00
efe1176dd9 specgen,run: support running container from valid manifest list
Following PR adds support for running containers from a manifest list
present on localstorage. Before this PR podman only supports running
containers from valid images but not from manifest list.

So `podman run -it --platform <some> <manifest-list> command` should
become functional now and users should be able to resolve images on the
bases of provided `--platform` string.

Example
```
podman manifest create test
podman build --platform linux/amd64,linux/arm64 --manifest test .
podman run --rm --platform linux/arm64/v8 test uname -a
```

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

Signed-off-by: Aditya R <arajan@redhat.com>
2022-07-05 12:39:37 +05:30
3e7e66edad Merge pull request #14822 from Luap99/dns-test
fix flake in aardvark tests
2022-07-04 16:50:01 +00:00
8601ab6b06 Silence setlocale warnings from podman machine ssh
Connecting with `podman machine ssh` can results in the following
warning:

```
/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_CA.UTF-8)
/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_CA.UTF-8)
/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_CA.UTF-8)
/usr/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_CA.UTF-8)
```

Best would probably be to remove `LC_ALL` (and other locale and lang
env vars) from `/etc/ssh/sshd_config.d/50-redhat.conf` in the CoreOS
image, but I'm not terribly sure how, so this is a quick alternative.

[NO NEW TESTS NEEDED]

Signed-off-by: Shane Smith <shane.smith@shopify.com>
2022-07-04 12:23:46 -04:00
33a474286b pkg/machine: add missing build tags to tests
Machine can only run on amd64 and arm64 platforms so we need to make
sure the test are only run on those platforms. We do not have CI checks
for this but it fails in debian build infra since debian supports many
other architectures as well.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-04 18:09:30 +02:00
5b1867923e TestEnvVarValue: fix assertion
assert.Equal() already follows to pointer and compares by value so we
can just directly pass the values. This will make errors much more
obvious. Also remove the fmt.Println() since the error now contains the
values.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-04 17:32:13 +02:00
3fbe933712 envVarValueResourceFieldRef: use int64 for value
int can be 32 or 64 bit depending on the architecture.
The total memory is int64 so we have to use int64 for the value as
well otherwise we get an overflow on 32 bit systems.

Fixes #14819

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-04 17:24:24 +02:00
4c5b058e86 fix flake in aardvark tests
The retry logic in digshort() did not work because dig always exits with
0 even when the domain name is not found. To make it work we have to
check the standard output.

We work on fixing the underlying issue in aardvark/netavark but
this will take more time.

Fixes #14173
Fixes #14171

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-04 17:16:14 +02:00
597de7a083 libpod/runtime: switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.

[NO NEW TESTS NEEDED]

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-04 15:39:00 +02:00
a406b950e4 Merge pull request #14807 from eriksjolund/fix_read_only_spelling
[CI:DOCS] Fix spelling "read only" -> "read-only"
2022-07-04 07:35:42 +00:00
b0abfc3cf6 Merge pull request #14816 from giuseppe/drop-pod-create--device-read-bps-test
test: drop pod-create --device-read-bps test
2022-07-04 04:09:10 +00:00
8106568ca2 test: drop pod-create --device-read-bps test
the test is not doing what it believes to do.  The containers are not
supposed to be joining the infra container cgroup.

In addition, the result is validated only on cgroup v1 systems (that
are not used in the CI).

We may want to add it back, or a variant of it, once the
--device-read-bps option applies to the pod parent cgroup.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-03 22:56:30 +02:00
73cdc925f0 Merge pull request #14802 from cdoern/podMemory
podman pod create --memory
2022-07-03 20:13:51 +00:00
5491123c2c [CI:DOCS] troubleshooting: document --tty and CR
* Add troubleshooting tip
  "Unexpected carriage returns are outputted on the terminal"

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-03 08:55:29 +02:00
fd33ab0936 Merge pull request #14808 from vorburger/patch-2
[CI:DOCS] Remove -s from systemctl enable --now sshd
2022-07-02 11:11:59 +00:00
fe559287c9 docs: Remove -s from systemctl enable --now sshd
This flag does not work (e.g. on Fedora 36) and not appear to be required (anymore?).

Signed-off-by: Michael Vorburger ⛑️ <mike@vorburger.ch>
2022-07-02 12:27:57 +02:00
24fcfb5d9e Fix spelling "read only" -> "read-only"
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-02 08:37:43 +02:00
2f1075dfbd Implement proxy support for Windows
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-07-01 16:34:24 -05:00
b92149e2a8 podman pod create --memory
using the new resource backend, implement podman pod create --memory which enables
users to modify memory.max inside of the parent cgroup (the pod), implicitly impacting all
children unless overriden

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-07-01 13:44:32 -04:00
8cff1c2bf8 Cirrus: Add podman-machine integration test
The podman-machine integration tests are designed to execute on
bare-metal, since they perform significant work with virtual-machines.
This test is costly to run at scale, so it is limited to being manually
triggered by developers (for now).  A 'trigger' button will appear in the
task status page of the Github WebUI once all test dependencies are met.
In the Cirrus-CI WebUI, there is also a 'pre-trigger' button that may be
pressed if a developer doesn't wish to wait. Also:

* Add a `localmachine` target in the `Makefile` on the off-chance
  developers wish to execute locally.  Update the `ginkgo-run` target
  to accommodate re-use by the new `localmachine` target.
* Exclude `podman_machine` task from `success` dependency verification.
  This also involves adding an exception to `cirrus_yaml_test.py`
  otherwise it will complain loudly.
* ***NOTE*** Inclusion of `ec2_instance` in *any* task will cause
  `hack/get_ci_vm.sh` to barf and be non-functional.  Future updates will
  be made to restore functionality.  Before then, simply comment out
  the `ec2_instance` section as a temporarily workaround.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-07-01 11:25:47 -04:00
f58d7dbdab Cirrus: Fix elevator workaround multi-cloud support
In order to support execution on various non-GCP cloud environments, the
BFQ scheduler workaround needs updating.  Previously it assumed the root
disk was always `/dev/sda`.  With the addition of new clouds (AWS) and
different environment types, the assumption is not always valid.  Update
the workaround to take care in looking up the block device where '/'
comes from.

Also update the scheduler to 'none', as all modern clouds already have
highly optimized underlying storage configurations.  There's no reason
to complicate I/O paths further by hard-coding specific scheduler(s) for
all environment types.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-07-01 11:25:47 -04:00
b00e65aa9c Merge pull request #14799 from vrothberg/fix-build
fix build
2022-07-01 14:42:03 +00:00
21cd3b2ed2 Merge pull request #14798 from flouthoc/overlay-mount-path-abs
overlay,mount: convert source to absolute path for `overlay` mounts of paths
2022-07-01 12:37:10 +00:00
7131c84723 fix build
PR containers/podman/pull/14449 had an outdated base.  Merging it broke
builds.

[NO NEW TESTS NEEDED]

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-01 14:20:31 +02:00
7688c5ac63 Merge pull request #14794 from n1hility/fix-win
Fix podman machine on Windows
2022-07-01 11:21:42 +00:00
a737412eeb Merge pull request #14795 from giuseppe/fix-wildcard-major-device-cgroup
specgen: fix parsing of cgroup devices rule
2022-07-01 11:13:49 +00:00
dc2a93421b Merge pull request #14788 from vrothberg/rename-template
podman-play-kube template: rename to podman-kube
2022-07-01 10:55:42 +00:00
d6678adc92 overlay,mount: convert lowerdir to absolute path for overlay mounts of path
When mounting paths as overlay mounts we end up passing source as is to
lowerdir options, resolve all relative paths in such cases for overlay
mounts.

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

Signed-off-by: Aditya R <arajan@redhat.com>
2022-07-01 14:19:01 +05:30
96e72d90b8 Merge pull request #14449 from cdoern/podVolumes
podman volume create --opt=o=timeout...
2022-07-01 08:46:11 +00:00
891dfd3a8f specgen: fix parsing of cgroup devices rule
Fix the parse for the cgroup devices rule to correctly handle the
wildcard syntax for the device major.

Also make sure the device major and minor are not negative numbers.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-01 09:28:18 +02:00
5262f7e01d Fix podman machine on Windows
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-06-30 16:21:59 -05:00
01beba3667 Merge pull request #14704 from baude/machinestopped
reveal machine error, ignore false state
2022-06-30 17:58:28 +00:00
5a222a8e60 Merge pull request #14787 from giuseppe/move-systemd-service-to-subcgroup
service: do not run under the root cgroup
2022-06-30 16:09:07 +00:00
9c658f4907 docs: mention the podman-kube template
Mention the template in the docs for play-kube and generate-systemd.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-06-30 17:09:53 +02:00
c6fb533ca6 podman-play-kube template: rename to podman-kube
With the upcoming plans of introducing a podman-kube command with
various subcommands, rename the podman-play-kube systemd template
to podman-kube before releasing it.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-06-30 17:09:51 +02:00
3e8ab31239 Merge pull request #14785 from saschagrunert/cmd-podman-errors
cmd/podman: switch to golang native error wrapping
2022-06-30 09:58:52 -04:00
aa109ae0f0 Merge pull request #14783 from flouthoc/api-image-lookup-manifest
api,images: add support for `LookupManifest` to `Image removal` REST API
2022-06-30 13:54:02 +00:00
bd51410b8d service: do not run under the root cgroup
at startup, when running on a cgroup v2 system, check if the current
process is running in the root cgroup and move it to a sub-cgroup,
otherwise Podman is not able to create cgroups and move processes
there.

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

[NO NEW TESTS NEEDED] it needs nested podman

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-06-30 14:51:18 +02:00
5c39797624 utils: move the cgroup if root on cgroupv2
if we are running on cgroupv2, force the creation of a sub-cgroup even
when we are at the root for the cgroup v2 unified mount.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-06-30 14:34:18 +02:00
e8adec5f41 cmd/podman: switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-06-30 12:58:57 +02:00
7bbfb3eb0d api,images: add support for LookupManifest to Image remove API
ImagesBatchRemoval and ImageRemoval now honors and accepts
`LookupManifest` parameter which further tells libimage to resolve to
manifest list if it exists instead of actual image.

Following PR also makes `podman-remote manifest rm` functional which was
broken till now.

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

Signed-off-by: Aditya R <arajan@redhat.com>
2022-06-30 14:56:42 +05:30
3426d56b92 Merge pull request #14770 from containers/dependabot/go_modules/github.com/stretchr/testify-1.8.0
build(deps): bump github.com/stretchr/testify from 1.7.5 to 1.8.0
2022-06-29 19:54:32 +00:00
2cc3f127f4 Merge pull request #14720 from sstosh/rm-option
Fix: Prevent OCI runtime directory remain
2022-06-29 19:51:53 +00:00
d6cdb996bc Merge pull request #14706 from ashley-cui/rootmach
Only allow Rootless runs of Podman Machine
2022-06-29 19:32:26 +00:00