Update RestartPolicy of container
Add `--restart` flag for `update` command, so we can change restart policy for a container no matter it's running or stopped. Signed-off-by: Zhang Wei <zhangwei555@huawei.com> Upstream-commit: ff3ea4c90f2ede5cccc6b49c4d2aad7201c91a4c Component: engine
This commit is contained in:
@ -79,11 +79,11 @@ type containerMonitor struct {
|
||||
|
||||
// StartMonitor initializes a containerMonitor for this container with the provided supervisor and restart policy
|
||||
// and starts the container's process.
|
||||
func (container *Container) StartMonitor(s supervisor, policy container.RestartPolicy) error {
|
||||
func (container *Container) StartMonitor(s supervisor) error {
|
||||
container.monitor = &containerMonitor{
|
||||
supervisor: s,
|
||||
container: container,
|
||||
restartPolicy: policy,
|
||||
restartPolicy: container.HostConfig.RestartPolicy,
|
||||
timeIncrement: defaultTimeIncrement,
|
||||
stopChan: make(chan struct{}),
|
||||
startSignal: make(chan struct{}),
|
||||
|
||||
Reference in New Issue
Block a user