mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
pkg/rootless: move to daemon/internal
This package is used internally by the daemon, and was only used out side of the daemon by pkg/plugins (for which we still need to look where it should be kept). Making it internal because it's trivial to implement if needed by anyone. The only reason it's a package is to keep it central, and to make it easier to discover where we have rootlesskit-specific codepaths in our codebase. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
package plugins
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/docker/docker/pkg/homedir"
|
||||
"github.com/docker/docker/pkg/rootless"
|
||||
)
|
||||
|
||||
func rootlessConfigPluginsPath() string {
|
||||
@@ -25,7 +25,8 @@ func rootlessLibPluginsPath() string {
|
||||
|
||||
// specsPaths is the non-Windows implementation of [SpecsPaths].
|
||||
func specsPaths() []string {
|
||||
if rootless.RunningWithRootlessKit() {
|
||||
// TODO(thaJeztah): switch back to daemon/internal/rootless.RunningWithRootlessKit if this package moves internal to the daemon.
|
||||
if os.Getenv("ROOTLESSKIT_STATE_DIR") != "" {
|
||||
return []string{rootlessConfigPluginsPath(), rootlessLibPluginsPath()}
|
||||
}
|
||||
return []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package rootless
|
||||
|
||||
import "os"
|
||||
|
||||
// RunningWithRootlessKit returns true if running under RootlessKit namespaces.
|
||||
func RunningWithRootlessKit() bool {
|
||||
return os.Getenv("ROOTLESSKIT_STATE_DIR") != ""
|
||||
}
|
||||
Reference in New Issue
Block a user