-
Notifications
You must be signed in to change notification settings - Fork 62
Add Volumes in Mount spec #1937
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
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1937 +/- ##
==========================================
- Coverage 72.54% 72.06% -0.48%
==========================================
Files 72 72
Lines 7930 8020 +90
==========================================
+ Hits 5753 5780 +27
- Misses 1710 1777 +67
+ Partials 467 463 -4 ☔ View full report in Codecov by Sentry. |
73ab64e to
e9ff6ff
Compare
| continue | ||
| } | ||
| if lineFields[2] == "btrfs" { | ||
| r := regexp.MustCompile(`(/.+)\[.*\]`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On btrfs mounted subvolume added in brackets something like /dev/sda1[/@/.snapshots/1/snapshot] hence we need to remove it from the SOURCE field, that's why there this extra parsing logic here.
pkg/config/config.go
Outdated
| Volumes: []*v1.VolumeMount{ | ||
| { | ||
| Mountpoint: constants.PersistentDir, | ||
| Device: fmt.Sprintf("PARTLABEL=%s", constants.PersistentPartName), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT partition labels are not configurable, only filesystem labels, so adding these here is fine, this is not does collision with eventual custom user labels.
In addition the user has the capability to completely rewrite this list in config.yaml if needed.
This commit allows to set specific additional mount points for block devices in mount command. They can be set by label, partlabel, uuid and device path. In addition this commit also introduces some logic to precompute initial fstab lines for sysroot and other mounts done in previous stages. Signed-off-by: David Cassany <[email protected]>
82a521b to
8001e7e
Compare
| keys = append(keys, v.Mountpoint) | ||
| } | ||
|
|
||
| sort.Strings(keys) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you are wondering this sorting keys logic to allow nested mountpoints such as having a volume mounted at /run/elemental and persistent mount point at /run/elemental/persistent. With this logic we make sure /run/elemental is mounted first.
Signed-off-by: David Cassany <[email protected]>
8001e7e to
c36837a
Compare
frelon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
This commit allows to set specific additional mount points for block devices in mount command. They can be set by label, partlabel, uuid and device path.
In addition this commit also introduces some logic to precompute initial fstab lines for sysroot and
other mounts done in previous stages.