buildIDMappedPaths constructs new lower directory paths through an idmapped mount of the commonDir. It takes the original lowerDirs, the commonDir of those dirs, and rewrites the paths to go through the idMappedDir directory to achieve idmapped lowerdirs ready for overlayfs
(lowerDirs []string, commonDir, idMappedDir string)
| 322 | // It takes the original lowerDirs, the commonDir of those dirs, and rewrites the paths |
| 323 | // to go through the idMappedDir directory to achieve idmapped lowerdirs ready for overlayfs |
| 324 | func buildIDMappedPaths(lowerDirs []string, commonDir, idMappedDir string) []string { |
| 325 | tmpLowerDirs := make([]string, 0, len(lowerDirs)) |
| 326 | |
| 327 | for _, lowerDir := range lowerDirs { |
| 328 | relativePath := strings.TrimPrefix(lowerDir, commonDir) |
| 329 | tmpLowerDirs = append(tmpLowerDirs, filepath.Join(idMappedDir, relativePath)) |
| 330 | } |
| 331 | |
| 332 | return tmpLowerDirs |
| 333 | } |
| 334 | |
| 335 | // parseMountOptions takes fstab style mount options and parses them for |
| 336 | // use with a standard mount() syscall |
no outgoing calls
searching dependent graphs…