Conversation
The runtime spec says the mount destination is a path inside the container, but runc also accepts a destination prefixed with the host rootfs path, stripping the prefix. This dates back to commit 087caf6, when Docker used to pass the full host path to the mountpoint. Add a comment explaining it. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
The test_mount_order test used host rootfs paths as mount destinations, relying on runc stripping the rootfs prefix, which is a legacy runc behavior not described by the runtime spec. Use paths inside the container instead, as the spec says, so the test can also be used with other runtimes (e.g. crun). Bind mount sources inside the container rootfs are still used, as this is what the test is about. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
kolyshkin
commented
Oct 1, 2026
| rootfs := root.Name() | ||
| // The runtime spec says the destination is a path inside the container, | ||
| // but for legacy reasons (see commit 087caf69) a destination with the | ||
| // host rootfs path prefix is also accepted, and the prefix is stripped. |
Contributor
Author
There was a problem hiding this comment.
Maybe add a warning for such paths in 1.6 and remove those in 1.8?
This was referenced Oct 1, 2026
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.
The
test_mount_ordertest used host rootfs paths as mount destinations, relying on runc stripping the rootfs prefix from a destination. This is legacy runc behavior (dating back to commit 087caf6, when Docker passed full host paths), not something described by the runtime spec, which says the destination is a path inside the container.Use container paths for destinations, so the test can be used with other runtimes (e.g. crun). Bind mount sources inside the container rootfs are still used, as this is what the test is about.
While at it, add a comment explaining the legacy behavior in the code.