restartmanager: add SetPolicy() to the RestartManager interface
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
d68b68fc43
commit
efb97da0da
2 changed files with 2 additions and 7 deletions
|
@ -557,13 +557,7 @@ func (container *Container) InitDNSHostConfig() {
|
||||||
|
|
||||||
// UpdateMonitor updates monitor configure for running container
|
// UpdateMonitor updates monitor configure for running container
|
||||||
func (container *Container) UpdateMonitor(restartPolicy containertypes.RestartPolicy) {
|
func (container *Container) UpdateMonitor(restartPolicy containertypes.RestartPolicy) {
|
||||||
type policySetter interface {
|
container.RestartManager().SetPolicy(restartPolicy)
|
||||||
SetPolicy(containertypes.RestartPolicy)
|
|
||||||
}
|
|
||||||
|
|
||||||
if rm, ok := container.RestartManager().(policySetter); ok {
|
|
||||||
rm.SetPolicy(restartPolicy)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FullHostname returns hostname and optional domain appended to it.
|
// FullHostname returns hostname and optional domain appended to it.
|
||||||
|
|
|
@ -23,6 +23,7 @@ var ErrRestartCanceled = errors.New("restart canceled")
|
||||||
type RestartManager interface {
|
type RestartManager interface {
|
||||||
Cancel()
|
Cancel()
|
||||||
ShouldRestart(exitCode uint32, hasBeenManuallyStopped bool, executionDuration time.Duration) (bool, chan error, error)
|
ShouldRestart(exitCode uint32, hasBeenManuallyStopped bool, executionDuration time.Duration) (bool, chan error, error)
|
||||||
|
SetPolicy(policy container.RestartPolicy)
|
||||||
}
|
}
|
||||||
|
|
||||||
type restartManager struct {
|
type restartManager struct {
|
||||||
|
|
Loading…
Reference in a new issue