diff --git a/VERSION b/VERSION index b8db01dc1..bfb7879ed 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.29d +0.7.29e diff --git a/cluster/calcium/create_container.go b/cluster/calcium/create_container.go index de894f456..19021469b 100644 --- a/cluster/calcium/create_container.go +++ b/cluster/calcium/create_container.go @@ -563,11 +563,11 @@ func (c *calcium) makeContainerOptions(index int, quota map[string]int, specs ty log.Debugf("App %s will bind %v", specs.Appname, binds) // log config - // 默认是配置里的driver, 如果entrypoint有指定json-file就用json-file. + // 默认是配置里的driver, 如果entrypoint有指定就用指定的. // 如果是debug模式就用syslog, 拿配置里的syslog配置来发送. logDriver := c.config.Docker.LogDriver - if entry.LogConfig == "json-file" { - logDriver = "json-file" + if entry.LogConfig != "" { + logDriver = entry.LogConfig } logConfig := enginecontainer.LogConfig{Type: logDriver} if opts.Debug { diff --git a/cluster/calcium/run_and_wait.go b/cluster/calcium/run_and_wait.go index e13d72d43..46a2d6dc8 100644 --- a/cluster/calcium/run_and_wait.go +++ b/cluster/calcium/run_and_wait.go @@ -18,7 +18,7 @@ func (c *calcium) RunAndWait(specs types.Specs, opts *types.DeployOptions) (chan // 强制为 json-file 输出 entry, _ := specs.Entrypoints[opts.Entrypoint] - entry.LogConfig = "json-file" + entry.LogConfig = "journald" specs.Entrypoints[opts.Entrypoint] = entry // 默认给出1200秒的超时时间吧 @@ -68,7 +68,8 @@ func (c *calcium) RunAndWait(specs types.Specs, opts *types.DeployOptions) (chan defer log.Infof("[RunAndWait] Container %s finished and removed", containerID[:12]) defer c.removeContainerSync([]string{containerID}) - ctx, _ := context.WithTimeout(context.Background(), time.Duration(waitTimeout)*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(waitTimeout)*time.Second) + defer cancel() resp, err := node.Engine.ContainerLogs(ctx, containerID, logsOpts) if err != nil { log.Errorf("[RunAndWait] Failed to get logs, %v", err)