Commit graph

12 commits

Author SHA1 Message Date
Peter c8f9117cef Fix mismatch between log messages and behavior of libpod.LabelVolumePath.
A reading of LabelVolumePath suggests that the intended behavior
upon encountering ENOTSUP is to log the issue and continue without
error, while all other errors in the Relabeling operation should
be considered errors of LabelVolumePath and passed up accordingly.

This is not the behavior that is encountered, as this test shows:
it is instead considered an error if and only if the Relabeling
operation returns ENOTSUP, spitting out a somewhat incongruous
error message, while all other error types that may be returned
are logged without being propogated, with an even more incongruous
error message saying that the operation was not supported.

The comparison was changed to match the behavior documented by the
log messages, and a test was added that will simulate executing
this function on a path where the mounted filesystem does not
support SELinux labels, with the assertion that the function should
not return an error in order to highlight the condition these
changes seek to alleviate.

Signed-off-by: Peter <peter@psanders.me>
2020-09-13 23:24:15 -04:00
Daniel J Walsh a5e37ad280
Switch all references to github.com/containers/libpod -> podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-28 08:23:45 -04:00
Valentin Rothberg 8489dc4345 move go module to v2
With the advent of Podman 2.0.0 we crossed the magical barrier of go
modules.  While we were able to continue importing all packages inside
of the project, the project could not be vendored anymore from the
outside.

Move the go module to new major version and change all imports to
`github.com/containers/libpod/v2`.  The renaming of the imports
was done via `gomove` [1].

[1] https://github.com/KSubedi/gomove

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-06 15:50:12 +02:00
Daniel J Walsh b4fa6f4f08
Fix SELinux labels of volumes
If we attempt to label a volume and the file system
does not support labeling, then just warn.  SELinux
may or may not work, on the volume.

There is no way to setup a private label on a newly
created volume without using the container mountlabel.

If we don't have a mount label at the time of creation of
the volume, the only option we have is to create a shared
label.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-13 21:42:57 -05:00
Marco Vedovati dacbc5beb2 rm: add containers eviction with rm --force
Add ability to evict a container when it becomes unusable. This may
happen when the host setup changes after a container creation, making it
impossible for that container to be used or removed.
Evicting a container is done using the `rm --force` command.

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2019-09-25 19:44:38 +02:00
Giuseppe Scrivano 9873901469
pkg/cgroups: use DBUS session when rootless
use the DBUS user session when running in rootless mode.

Closes: https://github.com/containers/libpod/issues/3801

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-08-14 15:46:07 +02:00
Giuseppe Scrivano e27fef335a
stats: fix cgroup path for rootless containers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-06-26 13:17:06 +02:00
Giuseppe Scrivano 72cf0c81e8
libpod: use pkg/cgroups instead of containerd/cgroups
use the new implementation for dealing with cgroups.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-06-26 13:17:02 +02:00
baude dd81a44ccf remove libpod from main
the compilation demands of having libpod in main is a burden for the
remote client compilations.  to combat this, we should move the use of
libpod structs, vars, constants, and functions into the adapter code
where it will only be compiled by the local client.

this should result in cleaner code organization and smaller binaries. it
should also help if we ever need to compile the remote client on
non-Linux operating systems natively (not cross-compiled).

Signed-off-by: baude <bbaude@redhat.com>
2019-06-25 13:51:24 -05:00
Peter Hunt 0d0ad59641 Default to SELinux private label for play kube mounts
Before, there were SELinux denials when a volume was bind-mounted by podman play kube.
Partially fix this by setting the default private label for mounts created by play kube (with DirectoryOrCreate)
For volumes mounted as Directory, the user will have to set their own SELinux permissions on the mount point

also remove left over debugging print statement

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-03-28 09:54:31 -04:00
Miloslav Trmač b70f8b3884 Fix build on non-Linux
Unrelated to the rest of the PR.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2018-12-06 23:31:54 +01:00
Matthew Heon 74cf870792 Fix build on non-Linux OSes
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #1266
Approved by: baude
2018-08-15 18:07:04 +00:00