Skip to content

Commit

Permalink
Merge branch 'refactor/restart-policy' into 'master'
Browse files Browse the repository at this point in the history
cannot use MaximumRetryCount with restart:always

See merge request !100
  • Loading branch information
CMGS committed Jun 19, 2017
2 parents 129cd7c + bb20b47 commit f446ea1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.32
0.7.33
7 changes: 6 additions & 1 deletion cluster/calcium/create_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,12 +683,17 @@ func (c *calcium) makeContainerOptions(index int, quota map[string]int, specs ty
}
}

restartPolicy := entry.RestartPolicy
maximumRetryCount := 3
if restartPolicy == "always" {
maximumRetryCount = 0
}
hostConfig := &enginecontainer.HostConfig{
Binds: binds,
DNS: dns,
LogConfig: logConfig,
NetworkMode: enginecontainer.NetworkMode(networkMode),
RestartPolicy: enginecontainer.RestartPolicy{Name: entry.RestartPolicy, MaximumRetryCount: 3},
RestartPolicy: enginecontainer.RestartPolicy{Name: restartPolicy, MaximumRetryCount: maximumRetryCount},
CapAdd: engineslice.StrSlice(capAdd),
ExtraHosts: entry.ExtraHosts,
Privileged: entry.Privileged != "",
Expand Down

0 comments on commit f446ea1

Please sign in to comment.