mirror of
https://github.com/kairos-io/immucore.git
synced 2025-08-12 11:32:30 +00:00
23 lines
445 B
Go
23 lines
445 B
Go
|
package mount
|
||
|
|
||
|
import (
|
||
|
"github.com/containerd/containerd/mount"
|
||
|
"github.com/deniswernert/go-fstab"
|
||
|
)
|
||
|
|
||
|
type mountOperation struct {
|
||
|
FstabEntry fstab.Mount
|
||
|
MountOption mount.Mount
|
||
|
Target string
|
||
|
PrepareCallback func() error
|
||
|
}
|
||
|
|
||
|
func (m mountOperation) run() error {
|
||
|
if m.PrepareCallback != nil {
|
||
|
if err := m.PrepareCallback(); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
}
|
||
|
return mount.All([]mount.Mount{m.MountOption}, m.Target)
|
||
|
}
|