MCPcopy Create free account
hub / github.com/coder/envbuilder / TempRemount

Function TempRemount

internal/ebutil/remount.go:37–40  ·  view source on GitHub ↗

TempRemount iterates through all read-only mounted filesystems, bind-mounts them at dest, and unmounts them from their original source. All mount points underneath ignorePrefixes will not be touched. Some container runtimes such as sysbox-runc will mount in `/lib/modules` read-only. See https://git

(logf log.Func, dest string, ignorePrefixes ...string)

Source from the content-addressed store, hash-verified

35// the operation, calling the returned function will make a best-effort attempt to restore
36// the original state.
37func TempRemount(logf log.Func, dest string, ignorePrefixes ...string) (restore func() error, err error,
38) {
39 return tempRemount(&realMounter{}, logf, dest, ignorePrefixes...)
40}
41
42func tempRemount(m mounter, logf log.Func, base string, ignorePrefixes ...string) (restore func() error, err error) {
43 mountInfos, err := m.GetMounts()

Callers 1

runFunction · 0.92

Calls 1

tempRemountFunction · 0.85

Tested by

no test coverage detected