Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@@ -557,13 +557,7 @@ func (container *Container) InitDNSHostConfig() {
// UpdateMonitor updates monitor configure for running container
func (container *Container) UpdateMonitor(restartPolicy containertypes.RestartPolicy) {
- type policySetter interface {
- SetPolicy(containertypes.RestartPolicy)
- }
-
- if rm, ok := container.RestartManager().(policySetter); ok {
- rm.SetPolicy(restartPolicy)
+ container.RestartManager().SetPolicy(restartPolicy)
}
// FullHostname returns hostname and optional domain appended to it.
@@ -23,6 +23,7 @@ var ErrRestartCanceled = errors.New("restart canceled")
type RestartManager interface {
Cancel()
ShouldRestart(exitCode uint32, hasBeenManuallyStopped bool, executionDuration time.Duration) (bool, chan error, error)
+ SetPolicy(policy container.RestartPolicy)
type restartManager struct {