From 20b0841c1bd07c6add812597e0d656d7584e48ac Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Wed, 6 Aug 2014 12:31:09 +0000 Subject: [PATCH] Remove last trace of Daemon->Server dependency This removes a shim `daemon.Server` interface which was used to start separating Daemon from Server *gradually*, without getting cyclic dependency errors. Now that the last Daemon->Server dependency has been removed, we can finally remove the shim. Yay! Signed-off-by: Solomon Hykes --- daemon/container.go | 4 +--- daemon/daemon.go | 5 ----- daemon/server.go | 5 ----- server/init.go | 1 - 4 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 daemon/server.go diff --git a/daemon/container.go b/daemon/container.go index 871b1d67cf..612ef6a733 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -514,9 +514,7 @@ func (container *Container) monitor(callback execdriver.StartCallback) error { if container.Config.OpenStdin { container.stdin, container.stdinPipe = io.Pipe() } - if container.daemon != nil && container.daemon.srv != nil { - container.LogEvent("die") - } + container.LogEvent("die") // If the engine is shutting down, don't save the container state as stopped. // This will cause it to be restarted when the engine is restarted. if container.daemon != nil && container.daemon.eng != nil && !container.daemon.eng.IsShutdown() { diff --git a/daemon/daemon.go b/daemon/daemon.go index 3e990f449d..2409b1dc13 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -94,7 +94,6 @@ type Daemon struct { idIndex *truncindex.TruncIndex sysInfo *sysinfo.SysInfo volumes *graph.Graph - srv Server eng *engine.Engine config *daemonconfig.Config containerGraph *graphdb.Database @@ -1032,10 +1031,6 @@ func (daemon *Daemon) ContainerGraph() *graphdb.Database { return daemon.containerGraph } -func (daemon *Daemon) SetServer(server Server) { - daemon.srv = server -} - func (daemon *Daemon) checkLocaldns() error { resolvConf, err := resolvconf.Get() if err != nil { diff --git a/daemon/server.go b/daemon/server.go deleted file mode 100644 index af923d935a..0000000000 --- a/daemon/server.go +++ /dev/null @@ -1,5 +0,0 @@ -package daemon - -// FIXME: this shim interface is no longer needed, it can be removed -type Server interface { -} diff --git a/server/init.go b/server/init.go index 3cd472149e..3738d0c541 100644 --- a/server/init.go +++ b/server/init.go @@ -64,6 +64,5 @@ func NewServer(eng *engine.Engine, config *daemonconfig.Config) (*Server, error) pullingPool: make(map[string]chan struct{}), pushingPool: make(map[string]chan struct{}), } - daemon.SetServer(srv) return srv, nil }