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:
@@ -29,6 +29,7 @@ import (
|
||||
"github.com/docker/docker/daemon/internal/builder-next/exporter"
|
||||
"github.com/docker/docker/daemon/internal/libcontainerd/supervisor"
|
||||
"github.com/docker/docker/daemon/internal/otelutil"
|
||||
"github.com/docker/docker/daemon/internal/rootless"
|
||||
"github.com/docker/docker/daemon/listeners"
|
||||
dopts "github.com/docker/docker/daemon/pkg/opts"
|
||||
"github.com/docker/docker/daemon/pkg/plugin"
|
||||
@@ -53,7 +54,6 @@ import (
|
||||
"github.com/docker/docker/pkg/homedir"
|
||||
"github.com/docker/docker/pkg/pidfile"
|
||||
"github.com/docker/docker/pkg/plugingetter"
|
||||
"github.com/docker/docker/pkg/rootless"
|
||||
"github.com/docker/go-connections/tlsconfig"
|
||||
"github.com/moby/buildkit/session"
|
||||
"github.com/moby/buildkit/util/tracing/detect"
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
|
||||
"github.com/containerd/log"
|
||||
"github.com/docker/docker/daemon/config"
|
||||
"github.com/docker/docker/daemon/internal/rootless"
|
||||
"github.com/docker/docker/dockerversion"
|
||||
"github.com/docker/docker/pkg/rootless"
|
||||
"github.com/moby/buildkit/util/apicaps"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -11,10 +11,10 @@ import (
|
||||
|
||||
"github.com/containerd/cgroups/v3"
|
||||
"github.com/containerd/log"
|
||||
"github.com/docker/docker/daemon/internal/rootless"
|
||||
"github.com/docker/docker/daemon/libnetwork/drivers/bridge"
|
||||
"github.com/docker/docker/daemon/pkg/opts"
|
||||
"github.com/docker/docker/pkg/homedir"
|
||||
"github.com/docker/docker/pkg/rootless"
|
||||
"github.com/moby/moby/api/types/container"
|
||||
"github.com/moby/moby/api/types/system"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
runcoptions "github.com/containerd/containerd/api/types/runc/options"
|
||||
"github.com/containerd/log"
|
||||
"github.com/docker/docker/daemon/config"
|
||||
"github.com/docker/docker/pkg/rootless"
|
||||
"github.com/docker/docker/daemon/internal/rootless"
|
||||
"github.com/docker/docker/pkg/sysinfo"
|
||||
"github.com/moby/moby/api/types"
|
||||
containertypes "github.com/moby/moby/api/types/container"
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/containerd/log"
|
||||
"github.com/docker/docker/pkg/rootless"
|
||||
"github.com/docker/docker/daemon/internal/rootless"
|
||||
)
|
||||
|
||||
// Action signifies the iptable action.
|
||||
|
||||
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user