mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
daemon: move default namespaces to daemon/config
Keeping the defaults in a single location, which also reduces the list of imports needed. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
881e326f7a
commit
690a6fddf9
4 changed files with 6 additions and 12 deletions
|
@ -3,10 +3,8 @@ package main
|
||||||
import (
|
import (
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/docker/docker/daemon"
|
|
||||||
"github.com/docker/docker/daemon/config"
|
"github.com/docker/docker/daemon/config"
|
||||||
"github.com/docker/docker/opts"
|
"github.com/docker/docker/opts"
|
||||||
"github.com/docker/docker/plugin/executor/containerd"
|
|
||||||
"github.com/docker/docker/registry"
|
"github.com/docker/docker/registry"
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
)
|
)
|
||||||
|
@ -96,8 +94,8 @@ func installCommonConfigFlags(conf *config.Config, flags *pflag.FlagSet) error {
|
||||||
conf.MaxConcurrentUploads = &maxConcurrentUploads
|
conf.MaxConcurrentUploads = &maxConcurrentUploads
|
||||||
conf.MaxDownloadAttempts = &maxDownloadAttempts
|
conf.MaxDownloadAttempts = &maxDownloadAttempts
|
||||||
|
|
||||||
flags.StringVar(&conf.ContainerdNamespace, "containerd-namespace", daemon.ContainersNamespace, "Containerd namespace to use")
|
flags.StringVar(&conf.ContainerdNamespace, "containerd-namespace", config.DefaultContainersNamespace, "Containerd namespace to use")
|
||||||
flags.StringVar(&conf.ContainerdPluginNamespace, "containerd-plugins-namespace", containerd.PluginNamespace, "Containerd namespace to use for plugins")
|
flags.StringVar(&conf.ContainerdPluginNamespace, "containerd-plugins-namespace", config.DefaultPluginNamespace, "Containerd namespace to use for plugins")
|
||||||
|
|
||||||
flags.StringVar(&conf.DefaultRuntime, "default-runtime", config.StockRuntimeName, "Default OCI runtime for containers")
|
flags.StringVar(&conf.DefaultRuntime, "default-runtime", config.StockRuntimeName, "Default OCI runtime for containers")
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,10 @@ const (
|
||||||
// DefaultRuntimeBinary is the default runtime to be used by
|
// DefaultRuntimeBinary is the default runtime to be used by
|
||||||
// containerd if none is specified
|
// containerd if none is specified
|
||||||
DefaultRuntimeBinary = "runc"
|
DefaultRuntimeBinary = "runc"
|
||||||
|
// DefaultContainersNamespace is the name of the default containerd namespace used for users containers.
|
||||||
|
DefaultContainersNamespace = "moby"
|
||||||
|
// DefaultPluginNamespace is the name of the default containerd namespace used for plugins.
|
||||||
|
DefaultPluginNamespace = "plugins.moby"
|
||||||
|
|
||||||
// LinuxV1RuntimeName is the runtime used to specify the containerd v1 shim with the runc binary
|
// LinuxV1RuntimeName is the runtime used to specify the containerd v1 shim with the runc binary
|
||||||
// Note this is different than io.containerd.runc.v1 which would be the v1 shim using the v2 shim API.
|
// Note this is different than io.containerd.runc.v1 which would be the v1 shim using the v2 shim API.
|
||||||
|
|
|
@ -69,11 +69,6 @@ import (
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ContainersNamespace is the name of the namespace used for users containers
|
|
||||||
const (
|
|
||||||
ContainersNamespace = "moby"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
errSystemNotSupported = errors.New("the Docker daemon is not supported on this platform")
|
errSystemNotSupported = errors.New("the Docker daemon is not supported on this platform")
|
||||||
)
|
)
|
||||||
|
|
|
@ -16,9 +16,6 @@ import (
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PluginNamespace is the name used for the plugins namespace
|
|
||||||
const PluginNamespace = "plugins.moby"
|
|
||||||
|
|
||||||
// ExitHandler represents an object that is called when the exit event is received from containerd
|
// ExitHandler represents an object that is called when the exit event is received from containerd
|
||||||
type ExitHandler interface {
|
type ExitHandler interface {
|
||||||
HandleExitEvent(id string) error
|
HandleExitEvent(id string) error
|
||||||
|
|
Loading…
Add table
Reference in a new issue