From 521e7eba86df25857647b93f13e5366c554e9d63 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Fri, 15 Dec 2017 14:48:31 -0800 Subject: [PATCH] daemon, plugin: follow containerd namespace conventions Follow the conventions for namespace naming set out by other projects, such as linuxkit and cri-containerd. Typically, they are some sort of host name, with a subdomain describing functionality of the namespace. In the case of linuxkit, services are launched in `services.linuxkit`. In cri-containerd, pods are launched in `k8s.io`, making it clear that these are from kubernetes. Signed-off-by: Stephen J Day --- daemon/daemon.go | 6 +++--- integration-cli/docker_cli_daemon_test.go | 6 +++--- plugin/executor/containerd/containerd.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/daemon/daemon.go b/daemon/daemon.go index e63e2097f1..b0c8850c19 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -62,8 +62,8 @@ import ( "github.com/pkg/errors" ) -// MainNamespace is the name of the namespace used for users containers -const MainNamespace = "moby" +// ContainersNamespace is the name of the namespace used for users containers +const ContainersNamespace = "moby" var ( errSystemNotSupported = errors.New("the Docker daemon is not supported on this platform") @@ -890,7 +890,7 @@ func NewDaemon(config *config.Config, registryService registry.Service, containe go d.execCommandGC() - d.containerd, err = containerdRemote.NewClient(MainNamespace, d) + d.containerd, err = containerdRemote.NewClient(ContainersNamespace, d) if err != nil { return nil, err } diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index 6865b9280a..fb616261d4 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -1451,7 +1451,7 @@ func (s *DockerDaemonSuite) TestCleanupMountsAfterDaemonAndContainerKill(c *chec // kill the container icmd.RunCommand(ctrBinary, "--address", "/var/run/docker/containerd/docker-containerd.sock", - "--namespace", moby_daemon.MainNamespace, "tasks", "kill", id).Assert(c, icmd.Success) + "--namespace", moby_daemon.ContainersNamespace, "tasks", "kill", id).Assert(c, icmd.Success) // restart daemon. d.Restart(c) @@ -2011,7 +2011,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithKilledRunningContainer(t *check // kill the container icmd.RunCommand(ctrBinary, "--address", "/var/run/docker/containerd/docker-containerd.sock", - "--namespace", moby_daemon.MainNamespace, "tasks", "kill", cid).Assert(t, icmd.Success) + "--namespace", moby_daemon.ContainersNamespace, "tasks", "kill", cid).Assert(t, icmd.Success) // Give time to containerd to process the command if we don't // the exit event might be received after we do the inspect @@ -2106,7 +2106,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithUnpausedRunningContainer(t *che result := icmd.RunCommand( ctrBinary, "--address", "/var/run/docker/containerd/docker-containerd.sock", - "--namespace", moby_daemon.MainNamespace, + "--namespace", moby_daemon.ContainersNamespace, "tasks", "resume", cid) result.Assert(t, icmd.Success) diff --git a/plugin/executor/containerd/containerd.go b/plugin/executor/containerd/containerd.go index 98394679d5..5343b858e0 100644 --- a/plugin/executor/containerd/containerd.go +++ b/plugin/executor/containerd/containerd.go @@ -16,7 +16,7 @@ import ( ) // PluginNamespace is the name used for the plugins namespace -var PluginNamespace = "moby-plugins" +var PluginNamespace = "plugins.moby" // ExitHandler represents an object that is called when the exit event is received from containerd type ExitHandler interface {