Commit graph

14313 commits

Author SHA1 Message Date
Valentin Rothberg
d2b26ac8a0 podman create: building local pause image: do not read ignore files
Make sure to ignore local {container,docker}ignore files when building a
local pause image.  Otherwise, we may mistakenly not be able to copy
catatonit into the build container.

Fixes: #13529
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-30 14:09:17 -04:00
Nirmal Patel
e01d9680ce Separator is no longer prepended when prefix is empty on podman generate systemd
When podman generate systemd is invoked, it previously did not check if
container-prefix or pod-prefix are empty. When these are empty, the file name
starts with the separator, which is hyphen by default. This results in files
like '-containername.service'.

The code now checks if these prefixes are empty. If they are, the filename no
longer adds a separator. Instead, it uses name or ID of the container or pod.

Closes #13272

Signed-off-by: Nirmal Patel <npate012@gmail.com>
2022-03-30 14:05:49 -04:00
Clayton Craft
2f76581cf9 [CI:DOCS]: Mention netavark limitations for macvlan/ipvlan drivers
The example is also improved to add the --subnet option, this option is required with netavark, else you get:
    Error: macvlan driver needs at least one subnet specified, DHCP is not supported with netavark

Signed-off-by: Clayton Craft <clayton@craftyguy.net>
2022-03-30 14:04:51 -04:00
Paul Holzinger
b7b8fedea9 fix empty newline in version output
When podman is build without git commit information it will print a
empty newline instead. This is undesirable and a regression introduced
in commit 7d22cc88ef.

To test build podman with `go build -mod=vendor -o bin/podman ./cmd/podman`
and check the output of bin/podman version with and without this commit.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-30 14:03:45 -04:00
Paul Holzinger
e424c64b47 slirp: fix setup on ipv6 disabled systems
When enable_ipv6=true is set for slirp4netns (default since podman v4),
we will try to set the accept sysctl. This sysctl will not exist on
systems that have ipv6 disabled. In this case we should not error and
just ignore the extra ipv6 setup.

Also the current logic to wait for the slirp4 setup was kinda broken, it
did not actually wait until the sysctl was set before starting slirp.
This should now be fixed by using two `sync.WaitGroup`s.

[NO NEW TESTS NEEDED]

Fixes #13388

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-30 14:01:52 -04:00
Jason T. Greene
4a0d74495e Fixes TTY & resizing on Mac and Windows
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-03-30 13:59:27 -04:00
Daniel J Walsh
32802d6a6d Fix handling of tmpfs-mode for tmpfs creation in compat mode
The permissions on disk were wrong since we were not converting to
octal.

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

[NO NEW TESTS NEEDED] Since we don't currently test using the docker
client

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-03-30 13:56:41 -04:00
Ed Santiago
37a9746332 Skip flaky pprof tests
pprof tests are way too flaky, and are causing problems for
community contributors who don't have privs to press Re-run.

There has been no activity or interest in fixing the bug,
and it's not something I can fix. So, just disable the test.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-03-30 13:53:15 -04:00
Ashley Cui
e308213a23 Move secret-verify-leak containerfile into its own Directory
Secret-verify-leak is causing flakes, when running in parallel tests.
This is because remote secrets are copied into the context directory to
send to the API server, and secret-verify-leak is doing a COPY * and
then checking if the temporary secret file ends up in the container or
not. Since all the temporary files are prefixed with
"podman-build-secret", this test checks if podman-build-secret is in the
image. However, when run in parallel with other tests, other temporary
podman-build-secrets might be in the context dir. Moving
secret-verify-leak into its own directory makes sure that the context
dir is used only by this one test.

Also renamed Dockerfile -> Containerfile and cleaned up unused
Containerfiles.

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-03-30 13:53:00 -04:00
Thibault Gagnaux
6d8d8fb718 Fixes: #13301 ("machine rm removes the mounted socket file on macos")
[NO NEW TESTS NEEDED]
Signed-off-by: Thibault Gagnaux <tgagnaux@gmail.com>
2022-03-30 13:41:15 -04:00
Urvashi Mohnani
5aa6b69198 Throw an error if kube yaml has duplicate ctr names
Error out if the kube yaml passed to play kube has more
than one container or init container with the same name.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-03-30 13:38:08 -04:00
Giuseppe Scrivano
f002a0c889 libpod: pods do not use cgroups if --cgroups=disabled
do not attempt to use cgroups with pods if the cgroups are disabled.
A similar check is already in place for containers.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-03-30 13:34:17 -04:00
Aditya R
69543d6c7a container: workdir resolution must consider symlink if explicitly configured
While resolving `workdir` we mostly create a `workdir` when `stat`
fails with `ENOENT` or `ErrNotExist` however following cases are not
true when user explicitly specifies a `workdir` while `running` using
`--workdir` which tells `podman` to only use workdir if its exists on
the container. Following configuration is implicity set with other
`run` mechanism like `podman play kube`

Problem with explicit `--workdir` or similar implicit config in `podman play
kube` is that currently podman ignores the fact that workdir can also be
a `symlink` and actual `link` could be valid.

Hence following commit ensures that in such scenarios when a `workdir`
is not found and we cannot create a `workdir` podman must perform a
check to ensure that if `workdir` is a `symlink` and `link` is resolved
successfully and resolved link is present on the container then we
return as it is.

Docker performs a similar behviour.

Signed-off-by: Aditya R <arajan@redhat.com>
2022-03-30 13:30:47 -04:00
OpenShift Merge Robot
0a839a59ec
Merge pull request #13694 from giuseppe/v4.0-backport-no-inheritable
[4.0] do not set the inheritable capabilities
2022-03-30 11:13:19 -04:00
Giuseppe Scrivano
e7b7fcbd8a
test: fix podman run test as rootless
aafa80918a introduced the regression.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
(cherry picked from commit 640c2d53a8)
2022-03-30 15:32:24 +02:00
Giuseppe Scrivano
7b368768c2
do not set the inheritable capabilities
The kernel never sets the inheritable capabilities for a process, they
are only set by userspace.  Emulate the same behavior.

Closes: CVE-2022-27649

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
(cherry picked from commit aafa80918a)
2022-03-30 15:32:18 +02:00
OpenShift Merge Robot
05f0834610
Merge pull request #13568 from n1hility/upgrade-v4.0
[v4.0] Add Windows installer support for upgrades
2022-03-25 09:15:17 +01:00
Daniel J Walsh
e46c886183
Merge pull request #13614 from vrothberg/backport
[v4.0] vendor c/common@v0.47.5
2022-03-24 13:31:45 -04:00
OpenShift Merge Robot
477a9cdb9d
Merge pull request #13630 from flouthoc/backport-race-build-v4.0
[v4.0 backport] bump to race-free `c/image` and `c/storage` along with test to verify `concurrent/parallel` builds
2022-03-24 18:13:46 +01:00
OpenShift Merge Robot
0556a080ca
Merge pull request #13645 from lsm5/v4.0-cve-2022-21698
Bump github.com/prometheus/client_golang to v1.11.1
2022-03-24 18:03:45 +01:00
Lokesh Mandvekar
4ce9d2078a
Bump github.com/prometheus/client_golang to v1.11.1
Resolves: CVE-2022-21698

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2022-03-24 10:19:25 -04:00
Aditya R
44936c1496
test: add a test to verify race free concurrent/parallel builds
Invoking parallel/concurrent builds from podman race against each other
following behviour was fixed in
containers/storage#1153 and containers/image#1480

Test verifies if following bug is fixed in new race-free API or not.
Read more about this issue, see bz 2055487 for more details.

Test manually backported from: containers@63f92d0

Signed-off-by: Aditya R <arajan@redhat.com>
2022-03-24 12:27:37 +05:30
Aditya R
005a8e711c
vendor: bump c/image to v5.19.2
Bump c/image to upstream v5.19.2 so podman could use new race-free
code.

Signed-off-by: Aditya R <arajan@redhat.com>
2022-03-24 11:25:11 +05:30
Aditya R
926ffdb623
vendor: bump c/storage to v1.38.3
Bump c/storage to v1.38.3 so podman could use new `race-free`
`AddNames` and `RemoveNames` api

Signed-off-by: Aditya R <arajan@redhat.com>
2022-03-24 11:23:24 +05:30
Valentin Rothberg
9a77b70de3 vendor c/common@v0.47.5
Update the login tests to reflect the latest changes to allow http{s}
prefixes (again) to address bugzilla.redhat.com/show_bug.cgi?id=2062072.

Backport of commit 57cdc21b00.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-03-23 15:49:02 +01:00
Jason T. Greene
ac9b83573b Add Windows installer support for upgrades
Fixes duplicate installer entries after multiple installs

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-03-19 19:55:18 -05:00
OpenShift Merge Robot
19c80199a9
Merge pull request #13560 from n1hility/backport-handle-incompatible
[v4.0] Backport handling of incompatible machines
2022-03-19 11:28:38 +01:00
Jason T. Greene
6878376c42 Handle incompatible machines
Start in a reduced mode for recovery, warn, and provide instructions to recreate them

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-03-18 17:36:37 -05:00
Jason T. Greene
29e5559cbe Fix type-o and cleanup doc punctuation
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-03-18 17:36:37 -05:00
Brent Baude
35b2d951b2 machine rm -f stops and removes machine
If you want to remove a running machine, you can now pass the --force/-f
to podman machine rm and the machine will be stopped and removed without
confirmations.

Fixes: #13448

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-03-18 15:06:57 -05:00
Jason T. Greene
76a910b169 Improve agent install message to add restart instructions
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-03-18 15:06:57 -05:00
Brent Baude
44e9b539ee MacOS improvements
* Enable support of virtfs in Podman and darwin.  At the time of this writing, it requires a special patch not yet included in upstream qemu.
* Prefer to use a specially built qemu to support virtfs.  The qemu is installed under libexec/podman.

[NO NEW TESTS NEEDED]
Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-03-18 15:06:57 -05:00
OpenShift Merge Robot
e3184e963c
Merge pull request #13545 from cevich/backport_gvisor_url_fix
[v4.0] Backport: Fix windows win-sshproxy build
2022-03-18 12:40:38 +01:00
Paul Holzinger
f83d437d9b
Fix windows win-sshproxy build
Github no longer supports the unauthenticated git protocol, so switch
to using https instead.

https://github.blog/2021-09-01-improving-git-protocol-security-github/

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-03-17 14:03:28 -04:00
OpenShift Merge Robot
ec2fdb1350
Merge pull request #13480 from TomSweeneyRedHat/dev/tsweeney/fujiback
[v4.0] Backport Set default rule at the head of dev config
2022-03-13 11:24:12 -04:00
tomsweeneyredhat
61f6e1300a [v4.0] Backport Set default rule at the head of dev config
Backports: #13421 Set default rule at the head of device configuration
by @hshiina

The default rule should be set at the head of device configuration.
Otherwise, rules for user devices are overridden by the default rule so
that any access to the user devices are denied.

This has been requested to backport and to include in RHEL 8.6 and 9.0.
The exception process is underway.

Addresses these BZs for the backport:

https://bugzilla.redhat.com/show_bug.cgi?id=2059296
https://bugzilla.redhat.com/show_bug.cgi?id=2062835

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-03-10 18:18:11 -05:00
OpenShift Merge Robot
717edd7b84
Merge pull request #13405 from lsm5/v402
Release v4.0.2
2022-03-02 11:30:27 -05:00
Lokesh Mandvekar
0f626c377a
Bump to v4.0.3-dev
[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2022-03-02 09:14:29 -05:00
Lokesh Mandvekar
342c825938
Bump to v4.0.2
[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2022-03-02 09:04:36 -05:00
Lokesh Mandvekar
bd5ff1c32c
Update release notes for v4.0.2
[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2022-03-02 09:04:05 -05:00
OpenShift Merge Robot
965d28024c
Merge pull request #13392 from baude/v4reverts
V4reverts
2022-03-01 16:50:38 -05:00
Brent Baude
791c8c347c Revert "use GetRuntimeDir() from c/common"
This reverts commit fc5cf812c8.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-03-01 13:24:39 -06:00
Brent Baude
cc4a70c806 Revert "Option --url and --connection should imply --remote."
This reverts commit ca980c2e02.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-03-01 13:15:03 -06:00
OpenShift Merge Robot
cff448be2d
Merge pull request #13357 from Romain-Geissler-1A/backport-connection-implies-remote
Option --url and --connection should imply --remote.
2022-02-28 18:45:18 -05:00
Romain Geissler
ca980c2e02 Option --url and --connection should imply --remote.
Closes #13242

Signed-off-by: Romain Geissler <romain.geissler@amadeus.com>
2022-02-26 10:27:34 +00:00
OpenShift Merge Robot
49d511b6ee
Merge pull request #13329 from mheon/bump_401
Bump to v4.0.1
2022-02-23 16:43:02 -05:00
Matthew Heon
cfcc0d6398 Bump to v4.0.2-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-02-23 14:35:14 -05:00
Matthew Heon
c8b9a2e3ec Bump to v4.0.1
Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-02-23 14:34:57 -05:00
Matthew Heon
b1ffa822f8 Update release notes for v4.0.1
Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-02-23 14:34:34 -05:00
Matthew Heon
de9f228052 Fix a potential flake in volume plugins tests
We could remove the container running the volume plugins, before
the containers using the volume plugins; this could cause
unmounting the volumes to fail because the plugin could not be
contacted.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-02-23 14:33:34 -05:00