overlay[2] graphdriver: Fix/improve overlayfs support check for rootless#40194
Merged
AkihiroSuda merged 2 commits intomoby:masterfrom Nov 15, 2019
Merged
overlay[2] graphdriver: Fix/improve overlayfs support check for rootless#40194AkihiroSuda merged 2 commits intomoby:masterfrom
AkihiroSuda merged 2 commits intomoby:masterfrom
Conversation
Contributor
Author
|
@Caligatio could you test this? @thaJeztah @dmcgowan PTAL |
This moves supportsMultipleLowerDir() to overlayutils so it can be used from both overlay and overlay2. The only changes made were: * replace logger with logrus * don't use workDirName mergedDirName constants * add mnt var to improve readability a bit This is a preparation for the next commit. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Before this commit, overlay check was performed by looking for `overlay` in /proc/filesystem. This obviously might not work for rootless Docker (fs is there, but one can't use it as non-root). This commit changes the check to perform the actual mount, by reusing the code previously written to check for multiple lower dirs support. The old check is removed from both drivers, as well as the additional check for the multiple lower dirs support in overlay2 since it's now a part of the main check. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
8c3a366 to
649e4c8
Compare
Contributor
Author
|
fixed bad import statement (my system still had old |
|
I'm unfortunately away from a Docker-friendly computer for the weekend. I'll check it out on Monday and report back. |
|
This works like a champ on CentOS 7.7 choosing between |
AkihiroSuda
approved these changes
Nov 15, 2019
Member
|
merged via #40210 |
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.
Inspired by #40131
Overlay check is performed by looking for
overlayin/proc/filesystem. This obviously might not work for rootless Docker (fs is there, but one can't use it as non-root, for example, see docker-library/docker#193).This PR changes the check to perform the actual mount, by reusing the code previously written to check for multiple lower dirs support. The old check is removed from both drivers, as well as the additional check for the multiple lower dirs support in overlay2 since it's now a part of the main check.
The PR is split into two commits for the sake of easier review.
supportsMultipleLowerDirtooverlayutilswith minimal modificationsSupportsOverlay(), makes the multiple lower dir check optional, and makes both overlay and overlay2 use the new check.PS nice LOC reduction:
fixes docker/for-linux#836