Documentation
¶
Index ¶
- Constants
- type Manager
- func (m *Manager) Close()
- func (m *Manager) Detach()
- func (m *Manager) NumContainers() int
- func (m *Manager) ReattachContainers(ctx context.Context, expectedSurvivors []aproto.ContainerReattach) ([]aproto.ContainerReattachAck, error)
- func (m *Manager) RevalidateContainers(ctx context.Context, expectedSurvivors []aproto.ContainerReattach) ([]aproto.ContainerReattachAck, error)
- func (m *Manager) SignalContainer(ctx context.Context, msg aproto.SignalContainer)
- func (m *Manager) StartContainer(ctx context.Context, req aproto.StartContainer) error
Constants ¶
const (
// RecentExitsCacheSize is the number of cached stops we keep, before forgetting about them.
RecentExitsCacheSize = 32
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages containers. It is able to start and signal them and tracks some updates to their state.
func New ¶
func New( opts options.Options, mopts aproto.MasterSetAgentOptions, devices []device.Device, cl container.ContainerRuntime, pub events.Publisher[container.Event], ) (*Manager, error)
New returns a new container manager.
func (*Manager) Close ¶
func (m *Manager) Close()
Close all managed containers by sending them a SIGKILL and wait for them to close.
func (*Manager) Detach ¶
func (m *Manager) Detach()
Detach from all running containers without affecting them.
func (*Manager) NumContainers ¶
NumContainers returns the number of containers being managed.
func (*Manager) ReattachContainers ¶
func (m *Manager) ReattachContainers( ctx context.Context, expectedSurvivors []aproto.ContainerReattach, ) ([]aproto.ContainerReattachAck, error)
ReattachContainers takes a list of expected survivors and returns the results of the attempted reattach. A result is returned for every expected survivor. An error indicates a total failure.
func (*Manager) RevalidateContainers ¶
func (m *Manager) RevalidateContainers( ctx context.Context, expectedSurvivors []aproto.ContainerReattach, ) ([]aproto.ContainerReattachAck, error)
RevalidateContainers rectifies a list of containers the mananger is expected to know about with what the manager does know about, and returns updates about the expected containers.
func (*Manager) SignalContainer ¶
func (m *Manager) SignalContainer(ctx context.Context, msg aproto.SignalContainer)
SignalContainer signals a container.
func (*Manager) StartContainer ¶
StartContainer starts a container according to the provided spec, relaying its state changes via events.