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

Wrap mount.Interface to our own interface #1875

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

davidcassany
Copy link
Contributor

@davidcassany davidcassany commented Dec 11, 2023

This sets the actual mount interface we need in elemental and wraps k8s.io/mount-utils use in a single place. This makes our mounter interface way easier to substitute by another implementation if needed at some point. It also makes evident we need a simple mount interface.

Part of #1874

@davidcassany davidcassany requested a review from a team as a code owner December 11, 2023 18:16
type Mounter interface {
Mount(source string, target string, fstype string, options []string) error
Unmount(target string) error
IsLikelyNotMountPoint(file string) (bool, error)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the actual mounter interface we really need and the only place where we import the actual third party implementation.

Indeed it should be relatively simple to use another implementation, we could even provide our own in order to reduce third party dependencies.

@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2023

Codecov Report

Attention: 350 lines in your changes are missing coverage. Please review.

Comparison is base (840c80c) 75.96% compared to head (7158891) 72.47%.
Report is 2 commits behind head on main.

Files Patch % Lines
pkg/action/mount.go 5.94% 169 Missing and 5 partials ⚠️
cmd/config/config.go 3.50% 55 Missing ⚠️
pkg/config/config.go 15.78% 48 Missing ⚠️
pkg/types/v1/config.go 0.00% 28 Missing ⚠️
cmd/mount.go 23.07% 19 Missing and 1 partial ⚠️
pkg/features/features.go 18.75% 12 Missing and 1 partial ⚠️
pkg/constants/constants.go 0.00% 7 Missing ⚠️
pkg/systemd/unit.go 0.00% 3 Missing ⚠️
cmd/build-disk.go 0.00% 1 Missing ⚠️
cmd/init.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1875      +/-   ##
==========================================
- Coverage   75.96%   72.47%   -3.50%     
==========================================
  Files          66       69       +3     
  Lines        6912     7274     +362     
==========================================
+ Hits         5251     5272      +21     
- Misses       1290     1624     +334     
- Partials      371      378       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@frelon frelon left a comment

Choose a reason for hiding this comment

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

LGTM!

Signed-off-by: David Cassany <dcassany@suse.com>
@davidcassany davidcassany enabled auto-merge (squash) December 12, 2023 14:27
@davidcassany davidcassany merged commit dbc590d into rancher:main Dec 12, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants