Skip to content

Commit

Permalink
Merge branch 'close' into 'master'
Browse files Browse the repository at this point in the history
Close

See merge request !95
  • Loading branch information
CMGS committed May 12, 2017
2 parents 44aca7c + 91683a2 commit 654daa7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cluster/calcium/create_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,11 +566,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 {
Expand Down
5 changes: 3 additions & 2 deletions cluster/calcium/run_and_wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -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秒的超时时间吧
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 654daa7

Please sign in to comment.