Bläddra i källkod

Add logdrivers to executor from swarmkit

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Tonis Tiigi 9 år sedan
förälder
incheckning
8a50315f3c
1 ändrade filer med 10 tillägg och 1 borttagningar
  1. 10 1
      daemon/cluster/executor/container/container.go

+ 10 - 1
daemon/cluster/executor/container/container.go

@@ -266,11 +266,20 @@ func getMountMask(m *api.Mount) string {
 }
 
 func (c *containerConfig) hostConfig() *enginecontainer.HostConfig {
-	return &enginecontainer.HostConfig{
+	hc := &enginecontainer.HostConfig{
 		Resources: c.resources(),
 		Binds:     c.binds(),
 		Tmpfs:     c.tmpfs(),
 	}
+
+	if c.task.LogDriver != nil {
+		hc.LogConfig = enginecontainer.LogConfig{
+			Type:   c.task.LogDriver.Name,
+			Config: c.task.LogDriver.Options,
+		}
+	}
+
+	return hc
 }
 
 // This handles the case of volumes that are defined inside a service Mount