Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Volume mount scanner host fs into scanner container #435

Merged
1 commit merged into from
Jun 28, 2023

Conversation

ghost
Copy link

@ghost ghost commented Jun 27, 2023

Containers can only be aware of device mount points which are within their containerized filesystem. This means that if a device is mounted somewhere on the host, and that location on the host is not exposed to the container, the container can not determine if its mount or not.

This commit resolves this issue by making the whole host filesystem available for the container to see by mounting it into a sub-directory called /hostfs within the containers filesystem.

Once the container can see the host filesystem, all volumes which are mounted by the host or by the scanner have a mount point defined in lsblk.

Description

Please provide a meaningful description of what this change will do, or is for. Bonus points for including links to
related issues, other PRs, or technical references.

Note that by not including a description, you are asking reviewers to do extra work to understand the context of this
change, which may lead to your PR taking much longer to review, or result in it not being reviewed at all.

Type of Change

[X] Bug Fix
[ ] New Feature
[ ] Breaking Change
[ ] Refactor
[ ] Documentation
[ ] Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

Containers can only be aware of device mount points which are within
their containerized filesystem. This means that if a device is mounted
somewhere on the host, and that location on the host is not exposed to
the container, the container can not determine if its mount or not.

This commit resolves this issue by making the whole host filesystem
available for the container to see by mounting it into a sub-directory
called `/hostfs` within the containers filesystem.

Once the container can see the host filesystem, all volumes which are
mounted by the host or by the scanner have a mount point defined in
`lsblk`.
@ghost ghost self-requested a review as a code owner June 27, 2023 12:06
@ghost ghost changed the title Volume mount scanner host fs into scanner container fix: Volume mount scanner host fs into scanner container Jun 27, 2023
@ghost ghost added this to the v0.5.0 milestone Jun 27, 2023
@ghost ghost self-assigned this Jun 27, 2023
@ghost ghost added the bug Something isn't working label Jun 27, 2023
Copy link
Contributor

@chrisgacsal chrisgacsal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! :shipit:

@ghost ghost added this pull request to the merge queue Jun 28, 2023
Merged via the queue into main with commit fa7252d Jun 28, 2023
5 checks passed
@ghost ghost deleted the host_mount_detection branch June 28, 2023 07:37
adamtagscherer pushed a commit that referenced this pull request Jun 29, 2023
Containers can only be aware of device mount points which are within
their containerized filesystem. This means that if a device is mounted
somewhere on the host, and that location on the host is not exposed to
the container, the container can not determine if its mount or not.

This commit resolves this issue by making the whole host filesystem
available for the container to see by mounting it into a sub-directory
called `/hostfs` within the containers filesystem.

Once the container can see the host filesystem, all volumes which are
mounted by the host or by the scanner have a mount point defined in
`lsblk`.
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants