Browse code

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 <solomon@docker.com>

Solomon Hykes authored on 2014/08/06 21:31:09
Showing 4 changed files
... ...
@@ -514,9 +514,7 @@ func (container *Container) monitor(callback execdriver.StartCallback) error {
514 514
 	if container.Config.OpenStdin {
515 515
 		container.stdin, container.stdinPipe = io.Pipe()
516 516
 	}
517
-	if container.daemon != nil && container.daemon.srv != nil {
518
-		container.LogEvent("die")
519
-	}
517
+	container.LogEvent("die")
520 518
 	// If the engine is shutting down, don't save the container state as stopped.
521 519
 	// This will cause it to be restarted when the engine is restarted.
522 520
 	if container.daemon != nil && container.daemon.eng != nil && !container.daemon.eng.IsShutdown() {
... ...
@@ -94,7 +94,6 @@ type Daemon struct {
94 94
 	idIndex        *truncindex.TruncIndex
95 95
 	sysInfo        *sysinfo.SysInfo
96 96
 	volumes        *graph.Graph
97
-	srv            Server
98 97
 	eng            *engine.Engine
99 98
 	config         *daemonconfig.Config
100 99
 	containerGraph *graphdb.Database
... ...
@@ -1032,10 +1031,6 @@ func (daemon *Daemon) ContainerGraph() *graphdb.Database {
1032 1032
 	return daemon.containerGraph
1033 1033
 }
1034 1034
 
1035
-func (daemon *Daemon) SetServer(server Server) {
1036
-	daemon.srv = server
1037
-}
1038
-
1039 1035
 func (daemon *Daemon) checkLocaldns() error {
1040 1036
 	resolvConf, err := resolvconf.Get()
1041 1037
 	if err != nil {
1042 1038
deleted file mode 100644
... ...
@@ -1,5 +0,0 @@
1
-package daemon
2
-
3
-// FIXME: this shim interface is no longer needed, it can be removed
4
-type Server interface {
5
-}
... ...
@@ -64,6 +64,5 @@ func NewServer(eng *engine.Engine, config *daemonconfig.Config) (*Server, error)
64 64
 		pullingPool: make(map[string]chan struct{}),
65 65
 		pushingPool: make(map[string]chan struct{}),
66 66
 	}
67
-	daemon.SetServer(srv)
68 67
 	return srv, nil
69 68
 }