From 83764b84ec1aebfae0053a52b67d7f357545b6c9 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 8 Jan 2020 14:21:35 +0100 Subject: fix lint in pkg/rootless Signed-off-by: Valentin Rothberg --- pkg/rootless/rootless.go | 3 +++ pkg/rootless/rootless_linux.go | 2 ++ 2 files changed, 5 insertions(+) (limited to 'pkg/rootless') diff --git a/pkg/rootless/rootless.go b/pkg/rootless/rootless.go index 7e9fe9db6..d02721ea9 100644 --- a/pkg/rootless/rootless.go +++ b/pkg/rootless/rootless.go @@ -7,6 +7,9 @@ import ( "github.com/pkg/errors" ) +// TryJoinPauseProcess attempts to join the namespaces of the pause PID via +// TryJoinFromFilePaths. If joining fails, it attempts to delete the specified +// file. func TryJoinPauseProcess(pausePidPath string) (bool, int, error) { if _, err := os.Stat(pausePidPath); err != nil { return false, -1, nil diff --git a/pkg/rootless/rootless_linux.go b/pkg/rootless/rootless_linux.go index 94c42f7d0..182a39f6b 100644 --- a/pkg/rootless/rootless_linux.go +++ b/pkg/rootless/rootless_linux.go @@ -514,6 +514,8 @@ func TryJoinFromFilePaths(pausePidPath string, needNewNamespace bool, paths []st return joinUserAndMountNS(uint(pausePid), pausePidPath) } + +// ReadMappingsProc parses and returns the ID mappings at the specified path. func ReadMappingsProc(path string) ([]idtools.IDMap, error) { file, err := os.Open(path) if err != nil { -- cgit v1.2.3-54-g00ecf