Skip to content

Commit

Permalink
client/allocdir: ignore mount permission errors if root
Browse files Browse the repository at this point in the history
  • Loading branch information
stuart-warren committed Jul 26, 2024
1 parent afbd283 commit cd5ce3b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/allocdir/fs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ func createSecretDir(dir string) error {
flags := uintptr(syscall.MS_NOEXEC)
options := fmt.Sprintf("size=%dm", secretDirTmpfsSize)
if err := syscall.Mount("tmpfs", dir, "tmpfs", flags, options); err != nil {
if err == syscall.EPERM {
// If we don't have permission to mount tmpfs as root,
// just settle for MkdirAll() and continue.
// This might be blocked if it in undesirable to create
// a mount point in a separate namespace to dockerd
return nil
}
return os.NewSyscallError("mount", err)
}

Expand Down

0 comments on commit cd5ce3b

Please sign in to comment.