Fix relabeling local volume source dir#37739
Merged
thaJeztah merged 1 commit intomoby:masterfrom Aug 31, 2018
Merged
Conversation
In case a volume is specified via Mounts API, and SELinux is enabled, the following error happens on container start: > $ docker volume create testvol > $ docker run --rm --mount source=testvol,target=/tmp busybox true > docker: Error response from daemon: error setting label on mount > source '': no such file or directory. The functionality to relabel the source of a local mount specified via Mounts API was introduced in commit 5bbf5cc and later broken by commit e4b6adc, which removed setting mp.Source field. With the current data structures, the host dir is already available in v.Mountpoint, so let's just use it. Fixes: e4b6adc Signed-off-by: Kir Kolyshkin <[email protected]>
512389c to
27d9030
Compare
This was referenced Aug 31, 2018
Member
|
Some quick thoughts / questions (didn't dig into the whole code flow 😅);
|
Member
|
also; ping @cpuguy83 PTAL |
Contributor
|
The janky failure : |
Contributor
Author
I am not touching any non-volume code here so there should be no change.
I thought about that and can't think of any good unit test since the code and data are spread among the different subsystems. I can try adding an integration test though. |
thaJeztah
approved these changes
Aug 31, 2018
Member
thaJeztah
left a comment
There was a problem hiding this comment.
let's work on (e2e) tests in a follow up
LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did / - How I did it / - How to verify it
In case a volume is specified via Mounts API, and SELinux is enabled,
the following error happens on container start:
The functionality to relabel the source of a local mount specified via
Mounts API was introduced in commit 5bbf5cc (#34684) and later broken by commit
e4b6adc (#36688), which removed setting mp.Source field.
With the current data structures, the host dir is already available in
v.Mountpoint, so let's just use it.
Fixes: e4b6adc
- Description for the changelog
Fix relabeling of local volumes specified via Mounts API on selinux-enabled systems