restartmanager

package
v25.0.15+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2026 License: Apache-2.0 Imports: 5 Imported by: 188 modules, 373 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRestartCanceled = errors.New("restart canceled")

ErrRestartCanceled is returned when the restart manager has been canceled and will no longer restart the container.

Functions

This section is empty.

Types

type RestartManager

type RestartManager struct {
	sync.Mutex
	sync.Once
	// contains filtered or unexported fields
}

RestartManager defines object that controls container restarting rules.

func New

func New(policy container.RestartPolicy, restartCount int) *RestartManager

New returns a new RestartManager based on a policy.

func (*RestartManager) Cancel

func (rm *RestartManager) Cancel()

Cancel tells the RestartManager to no longer restart the container.

func (*RestartManager) SetPolicy

func (rm *RestartManager) SetPolicy(policy container.RestartPolicy)

SetPolicy sets the restart-policy for the RestartManager.

func (*RestartManager) ShouldRestart

func (rm *RestartManager) ShouldRestart(exitCode uint32, hasBeenManuallyStopped bool, executionDuration time.Duration) (bool, chan error, error)

ShouldRestart returns whether the container should be restarted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL