Documentation
¶
Overview ¶
Package engine contains code for interacting with container-running backends and handling events from them. It supports Docker as the sole task engine type.
Package engine contains the core logic for managing tasks ¶
Package engine contains the core logic for managing tasks
Index ¶
- Constants
- Variables
- type CannotCreateContainerError
- type CannotDescribeContainerError
- type CannotGetDockerClientError
- type CannotInspectContainerError
- type CannotListContainersError
- type CannotPullContainerError
- type CannotPullECRContainerError
- type CannotRemoveContainerError
- type CannotStartContainerError
- type CannotStopContainerError
- type ContainerNetworkingError
- type ContainerNotFound
- type ContainerVanishedError
- type CreateEmptyVolumeError
- type DockerClient
- type DockerContainerChangeEvent
- type DockerContainerMetadata
- type DockerStateError
- type DockerTaskEngine
- func (engine *DockerTaskEngine) AddTask(task *api.Task) error
- func (engine *DockerTaskEngine) CheckTaskState(task *api.Task)
- func (engine *DockerTaskEngine) Disable()
- func (engine *DockerTaskEngine) GetTaskByArn(arn string) (*api.Task, bool)
- func (engine *DockerTaskEngine) Init(ctx context.Context) error
- func (engine *DockerTaskEngine) ListTasks() ([]*api.Task, error)
- func (engine *DockerTaskEngine) MarshalJSON() ([]byte, error)
- func (engine *DockerTaskEngine) MustInit(ctx context.Context)
- func (engine *DockerTaskEngine) SetDockerClient(client DockerClient)
- func (engine *DockerTaskEngine) SetSaver(saver statemanager.Saver)
- func (engine *DockerTaskEngine) Shutdown()
- func (engine *DockerTaskEngine) State() dockerstate.TaskEngineState
- func (engine *DockerTaskEngine) StateChangeEvents() chan statechange.Event
- func (engine *DockerTaskEngine) UnmarshalJSON(data []byte) error
- func (engine *DockerTaskEngine) Version() (string, error)
- type DockerTimeoutError
- type ImageManager
- type ImageStatesForDeletion
- type ListContainersResponse
- type MockDockerClient
- func (_m *MockDockerClient) ContainerEvents(_param0 context.Context) (<-chan DockerContainerChangeEvent, error)
- func (_m *MockDockerClient) CreateContainer(_param0 *go_dockerclient.Config, _param1 *go_dockerclient.HostConfig, ...) DockerContainerMetadata
- func (_m *MockDockerClient) DescribeContainer(_param0 string) (api.ContainerStatus, DockerContainerMetadata)
- func (_m *MockDockerClient) EXPECT() *_MockDockerClientRecorder
- func (_m *MockDockerClient) ImportLocalEmptyVolumeImage() DockerContainerMetadata
- func (_m *MockDockerClient) InspectContainer(_param0 string, _param1 time.Duration) (*go_dockerclient.Container, error)
- func (_m *MockDockerClient) InspectImage(_param0 string) (*go_dockerclient.Image, error)
- func (_m *MockDockerClient) KnownVersions() []dockerclient.DockerVersion
- func (_m *MockDockerClient) ListContainers(_param0 bool, _param1 time.Duration) ListContainersResponse
- func (_m *MockDockerClient) LoadImage(_param0 io.Reader, _param1 time.Duration) error
- func (_m *MockDockerClient) PullImage(_param0 string, _param1 *api.RegistryAuthenticationData) DockerContainerMetadata
- func (_m *MockDockerClient) RemoveContainer(_param0 string, _param1 time.Duration) error
- func (_m *MockDockerClient) RemoveImage(_param0 string, _param1 time.Duration) error
- func (_m *MockDockerClient) StartContainer(_param0 string, _param1 time.Duration) DockerContainerMetadata
- func (_m *MockDockerClient) Stats(_param0 string, _param1 context.Context) (<-chan *go_dockerclient.Stats, error)
- func (_m *MockDockerClient) StopContainer(_param0 string, _param1 time.Duration) DockerContainerMetadata
- func (_m *MockDockerClient) SupportedVersions() []dockerclient.DockerVersion
- func (_m *MockDockerClient) Version() (string, error)
- func (_m *MockDockerClient) WithVersion(_param0 dockerclient.DockerVersion) DockerClient
- type MockImageManager
- func (_m *MockImageManager) AddAllImageStates(_param0 []*image.ImageState)
- func (_m *MockImageManager) EXPECT() *_MockImageManagerRecorder
- func (_m *MockImageManager) GetImageStateFromImageName(_param0 string) *image.ImageState
- func (_m *MockImageManager) RecordContainerReference(_param0 *api.Container) error
- func (_m *MockImageManager) RemoveContainerReferenceFromImageState(_param0 *api.Container) error
- func (_m *MockImageManager) SetSaver(_param0 statemanager.Saver)
- func (_m *MockImageManager) StartImageCleanupProcess(_param0 context0.Context)
- type MockTaskEngine
- func (_m *MockTaskEngine) AddTask(_param0 *api.Task) error
- func (_m *MockTaskEngine) Disable()
- func (_m *MockTaskEngine) EXPECT() *_MockTaskEngineRecorder
- func (_m *MockTaskEngine) GetTaskByArn(_param0 string) (*api.Task, bool)
- func (_m *MockTaskEngine) Init(_param0 context0.Context) error
- func (_m *MockTaskEngine) ListTasks() ([]*api.Task, error)
- func (_m *MockTaskEngine) MarshalJSON() ([]byte, error)
- func (_m *MockTaskEngine) MustInit(_param0 context0.Context)
- func (_m *MockTaskEngine) SetSaver(_param0 statemanager.Saver)
- func (_m *MockTaskEngine) StateChangeEvents() chan statechange.Event
- func (_m *MockTaskEngine) UnmarshalJSON(_param0 []byte) error
- func (_m *MockTaskEngine) Version() (string, error)
- type OutOfMemoryError
- type TaskDependencyError
- type TaskEngine
- type TaskStoppedBeforePullBeginError
Constants ¶
const ( // ListContainersTimeout is the timeout for the ListContainers API. ListContainersTimeout = 10 * time.Minute // LoadImageTimeout is the timeout for the LoadImage API. It's set // to much lower value than pullImageTimeout as it involves loading // image from either a file or STDIN // calls involved. // TODO: Benchmark and re-evaluate this value LoadImageTimeout = 10 * time.Minute // StatsInactivityTimeout controls the amount of time we hold open a // connection to the Docker daemon waiting for stats data StatsInactivityTimeout = 5 * time.Second )
Timelimits for docker operations enforced above docker
const ( //DockerEndpointEnvVariable is the environment variable that can override the Docker endpoint DockerEndpointEnvVariable = "DOCKER_HOST" // DockerDefaultEndpoint is the default value for the Docker endpoint DockerDefaultEndpoint = "unix:///var/run/docker.sock" )
Variables ¶
var ImagePullDeleteLock sync.RWMutex
ImagePullDeleteLock ensures that pulls and deletes do not run at the same time and pulls can be run at the same time for docker >= 1.11.1 Pulls are serialized as a temporary workaround for a devicemapper issue. (see https://github.com/docker/docker/issues/9718) Deletes must not run at the same time as pulls to prevent deletion of images that are being used to launch new tasks.
Functions ¶
This section is empty.
Types ¶
type CannotCreateContainerError ¶
type CannotCreateContainerError struct {
// contains filtered or unexported fields
}
CannotCreateContainerError indicates any error when trying to create a container
func (CannotCreateContainerError) Error ¶
func (err CannotCreateContainerError) Error() string
func (CannotCreateContainerError) ErrorName ¶
func (err CannotCreateContainerError) ErrorName() string
type CannotDescribeContainerError ¶
type CannotDescribeContainerError struct {
// contains filtered or unexported fields
}
CannotDescribeContainerError indicates any error when trying to describe a container
func (CannotDescribeContainerError) Error ¶
func (err CannotDescribeContainerError) Error() string
func (CannotDescribeContainerError) ErrorName ¶
func (err CannotDescribeContainerError) ErrorName() string
type CannotGetDockerClientError ¶
type CannotGetDockerClientError struct {
// contains filtered or unexported fields
}
CannotGetDockerClientError is a type for failing to get a specific Docker client
func (CannotGetDockerClientError) Error ¶
func (c CannotGetDockerClientError) Error() string
func (CannotGetDockerClientError) ErrorName ¶
func (CannotGetDockerClientError) ErrorName() string
ErrorName returns the name of the error
type CannotInspectContainerError ¶
type CannotInspectContainerError struct {
// contains filtered or unexported fields
}
CannotInspectContainerError indicates any error when trying to inspect a container
func (CannotInspectContainerError) Error ¶
func (err CannotInspectContainerError) Error() string
func (CannotInspectContainerError) ErrorName ¶
func (err CannotInspectContainerError) ErrorName() string
type CannotListContainersError ¶
type CannotListContainersError struct {
// contains filtered or unexported fields
}
CannotListContainersError indicates any error when trying to list containers
func (CannotListContainersError) Error ¶
func (err CannotListContainersError) Error() string
func (CannotListContainersError) ErrorName ¶
func (err CannotListContainersError) ErrorName() string
type CannotPullContainerError ¶
type CannotPullContainerError struct {
// contains filtered or unexported fields
}
CannotPullContainerError indicates any error when trying to pull a container image
func (CannotPullContainerError) Error ¶
func (err CannotPullContainerError) Error() string
func (CannotPullContainerError) ErrorName ¶
func (err CannotPullContainerError) ErrorName() string
type CannotPullECRContainerError ¶
type CannotPullECRContainerError struct {
// contains filtered or unexported fields
}
CannotPullECRContainerError indicates any error when trying to pull a container image from ECR
func (CannotPullECRContainerError) Error ¶
func (err CannotPullECRContainerError) Error() string
func (CannotPullECRContainerError) ErrorName ¶
func (err CannotPullECRContainerError) ErrorName() string
func (CannotPullECRContainerError) Retry ¶
func (err CannotPullECRContainerError) Retry() bool
Retry fulfills the utils.Retrier interface and allows retries to be skipped by utils.Retry* functions
type CannotRemoveContainerError ¶
type CannotRemoveContainerError struct {
// contains filtered or unexported fields
}
CannotRemoveContainerError indicates any error when trying to remove a container
func (CannotRemoveContainerError) Error ¶
func (err CannotRemoveContainerError) Error() string
func (CannotRemoveContainerError) ErrorName ¶
func (err CannotRemoveContainerError) ErrorName() string
type CannotStartContainerError ¶
type CannotStartContainerError struct {
// contains filtered or unexported fields
}
CannotStartContainerError indicates any error when trying to start a container
func (CannotStartContainerError) Error ¶
func (err CannotStartContainerError) Error() string
func (CannotStartContainerError) ErrorName ¶
func (err CannotStartContainerError) ErrorName() string
type CannotStopContainerError ¶
type CannotStopContainerError struct {
// contains filtered or unexported fields
}
CannotStopContainerError indicates any error when trying to stop a container
func (CannotStopContainerError) Error ¶
func (err CannotStopContainerError) Error() string
func (CannotStopContainerError) ErrorName ¶
func (err CannotStopContainerError) ErrorName() string
func (CannotStopContainerError) IsRetriableError ¶
func (err CannotStopContainerError) IsRetriableError() bool
IsRetriableError returns a boolean indicating whether the call that generated the error can be retried. When stopping a container, most errors that we can get should be considered retriable. However, in the case where the container is already stopped or doesn't exist at all, there's no sense in retrying.
type ContainerNetworkingError ¶
type ContainerNetworkingError struct {
// contains filtered or unexported fields
}
ContainerNetworkingError indicates any error when dealing with the network namespace of container
func (ContainerNetworkingError) Error ¶
func (err ContainerNetworkingError) Error() string
func (ContainerNetworkingError) ErrorName ¶
func (err ContainerNetworkingError) ErrorName() string
type ContainerNotFound ¶
ContainerNotFound is a type for a missing container
func (ContainerNotFound) Error ¶
func (cnferror ContainerNotFound) Error() string
type ContainerVanishedError ¶
type ContainerVanishedError struct{}
ContainerVanishedError is a type for describing a container that does not exist
func (ContainerVanishedError) Error ¶
func (err ContainerVanishedError) Error() string
func (ContainerVanishedError) ErrorName ¶
func (err ContainerVanishedError) ErrorName() string
ErrorName returns the name of the error
type CreateEmptyVolumeError ¶
type CreateEmptyVolumeError struct {
// contains filtered or unexported fields
}
func (CreateEmptyVolumeError) Error ¶
func (err CreateEmptyVolumeError) Error() string
func (CreateEmptyVolumeError) ErrorName ¶
func (err CreateEmptyVolumeError) ErrorName() string
func (CreateEmptyVolumeError) Retry ¶
func (err CreateEmptyVolumeError) Retry() bool
Retry fulfills the utils.Retrier interface and allows retries to be skipped by utils.Retry* functions
type DockerClient ¶
type DockerClient interface { // SupportedVersions returns a slice of the supported docker versions (or at least supposedly supported). SupportedVersions() []dockerclient.DockerVersion // KnownVersions returns a slice of the Docker API versions known to the Docker daemon. KnownVersions() []dockerclient.DockerVersion // WithVersion returns a new DockerClient for which all operations will use the given remote api version. // A default version will be used for a client not produced via this method. WithVersion(dockerclient.DockerVersion) DockerClient // ContainerEvents returns a channel of DockerContainerChangeEvents. Events are placed into the channel and should // be processed by the listener. ContainerEvents(ctx context.Context) (<-chan DockerContainerChangeEvent, error) // PullImage pulls an image. authData should contain authentication data provided by the ECS backend. PullImage(image string, authData *api.RegistryAuthenticationData) DockerContainerMetadata // ImportLocalEmptyVolumeImage imports a locally-generated empty-volume image for supported platforms. ImportLocalEmptyVolumeImage() DockerContainerMetadata // CreateContainer creates a container with the provided docker.Config, docker.HostConfig, and name. A timeout value // should be provided for the request. CreateContainer(*docker.Config, *docker.HostConfig, string, time.Duration) DockerContainerMetadata // StartContainer starts the container identified by the name provided. A timeout value should be provided for the // request. StartContainer(string, time.Duration) DockerContainerMetadata // StopContainer stops the container identified by the name provided. A timeout value should be provided for the // request. StopContainer(string, time.Duration) DockerContainerMetadata // DescribeContainer returns status information about the specified container. DescribeContainer(string) (api.ContainerStatus, DockerContainerMetadata) // RemoveContainer removes a container (typically the rootfs, logs, and associated metadata) identified by the name. // A timeout value should be provided for the request. RemoveContainer(string, time.Duration) error // InspectContainer returns information about the specified container. A timeout value should be provided for the // request. InspectContainer(string, time.Duration) (*docker.Container, error) // ListContainers returns the set of containers known to the Docker daemon. A timeout value should be provided for // the request. ListContainers(bool, time.Duration) ListContainersResponse // Stats returns a channel of stat data for the specified container. A context should be provided so the request can // be canceled. Stats(string, context.Context) (<-chan *docker.Stats, error) // Version returns the version of the Docker daemon. Version() (string, error) // InspectImage returns information about the specified image. InspectImage(string) (*docker.Image, error) // RemoveImage removes the metadata associated with an image and may remove the underlying layer data. A timeout // value should be provided for the request. RemoveImage(string, time.Duration) error LoadImage(io.Reader, time.Duration) error }
DockerClient interface to make testing it easier
func NewDockerGoClient ¶
func NewDockerGoClient(clientFactory dockerclient.Factory, cfg *config.Config) (DockerClient, error)
NewDockerGoClient creates a new DockerGoClient
type DockerContainerChangeEvent ¶
type DockerContainerChangeEvent struct { Status api.ContainerStatus DockerContainerMetadata }
DockerContainerChangeEvent is a type for container change events
type DockerContainerMetadata ¶
type DockerContainerMetadata struct { DockerID string ExitCode *int PortBindings []api.PortBinding Error engineError Volumes map[string]string }
DockerContainerMetadata is a type for metadata about Docker containers
type DockerStateError ¶
type DockerStateError struct {
// contains filtered or unexported fields
}
DockerStateError is a wrapper around the error docker puts in the '.State.Error' field of its inspect output.
func NewDockerStateError ¶
func NewDockerStateError(err string) DockerStateError
NewDockerStateError creates a DockerStateError
func (DockerStateError) Error ¶
func (err DockerStateError) Error() string
func (DockerStateError) ErrorName ¶
func (err DockerStateError) ErrorName() string
ErrorName returns the name of the error
type DockerTaskEngine ¶
type DockerTaskEngine struct {
// contains filtered or unexported fields
}
DockerTaskEngine is a state machine for managing a task and its containers in ECS.
DockerTaskEngine implements an abstraction over the DockerGoClient so that it does not have to know about tasks, only containers The DockerTaskEngine interacts with Docker to implement a TaskEngine
func NewDockerTaskEngine ¶
func NewDockerTaskEngine(cfg *config.Config, client DockerClient, credentialsManager credentials.Manager, containerChangeEventStream *eventstream.EventStream, imageManager ImageManager, state dockerstate.TaskEngineState) *DockerTaskEngine
NewDockerTaskEngine returns a created, but uninitialized, DockerTaskEngine. The distinction between created and initialized is that when created it may be serialized/deserialized, but it will not communicate with docker until it is also initialized.
func (*DockerTaskEngine) AddTask ¶
func (engine *DockerTaskEngine) AddTask(task *api.Task) error
AddTask starts tracking a task
func (*DockerTaskEngine) CheckTaskState ¶
func (engine *DockerTaskEngine) CheckTaskState(task *api.Task)
CheckTaskState inspects the state of all containers within a task and writes their state to the managed task's container channel.
func (*DockerTaskEngine) Disable ¶
func (engine *DockerTaskEngine) Disable()
Disable prevents this engine from managing any additional tasks.
func (*DockerTaskEngine) GetTaskByArn ¶
func (engine *DockerTaskEngine) GetTaskByArn(arn string) (*api.Task, bool)
GetTaskByArn returns the task identified by that ARN
func (*DockerTaskEngine) Init ¶
func (engine *DockerTaskEngine) Init(ctx context.Context) error
Init initializes a DockerTaskEngine such that it may communicate with docker and operate normally. This function must be called before any other function, except serializing and deserializing, can succeed without error.
func (*DockerTaskEngine) ListTasks ¶
func (engine *DockerTaskEngine) ListTasks() ([]*api.Task, error)
ListTasks returns the tasks currently managed by the DockerTaskEngine
func (*DockerTaskEngine) MarshalJSON ¶
func (engine *DockerTaskEngine) MarshalJSON() ([]byte, error)
MarshalJSON marshals into state directly
func (*DockerTaskEngine) MustInit ¶
func (engine *DockerTaskEngine) MustInit(ctx context.Context)
MustInit blocks and retries until an engine can be initialized.
func (*DockerTaskEngine) SetDockerClient ¶
func (engine *DockerTaskEngine) SetDockerClient(client DockerClient)
SetDockerClient provides a way to override the client used for communication with docker as a testing hook.
func (*DockerTaskEngine) SetSaver ¶
func (engine *DockerTaskEngine) SetSaver(saver statemanager.Saver)
SetSaver sets the saver that is used by the DockerTaskEngine
func (*DockerTaskEngine) Shutdown ¶
func (engine *DockerTaskEngine) Shutdown()
Shutdown makes a best-effort attempt to cleanup after the task engine. This should not be relied on for anything more complicated than testing.
func (*DockerTaskEngine) State ¶
func (engine *DockerTaskEngine) State() dockerstate.TaskEngineState
State is a function primarily meant for testing usage; it is explicitly not part of the TaskEngine interface and should not be relied upon. It returns an internal representation of the state of this DockerTaskEngine.
func (*DockerTaskEngine) StateChangeEvents ¶
func (engine *DockerTaskEngine) StateChangeEvents() chan statechange.Event
StateChangeEvents returns channels to read task and container state changes. These changes should be read as soon as possible as them not being read will block processing the task referenced by the event.
func (*DockerTaskEngine) UnmarshalJSON ¶
func (engine *DockerTaskEngine) UnmarshalJSON(data []byte) error
UnmarshalJSON restores a previously marshaled task-engine state from json
func (*DockerTaskEngine) Version ¶
func (engine *DockerTaskEngine) Version() (string, error)
Version returns the underlying docker version.
type DockerTimeoutError ¶
type DockerTimeoutError struct {
// contains filtered or unexported fields
}
DockerTimeoutError is an error type for describing timeouts
func (*DockerTimeoutError) Error ¶
func (err *DockerTimeoutError) Error() string
func (*DockerTimeoutError) ErrorName ¶
func (err *DockerTimeoutError) ErrorName() string
ErrorName returns the name of the error
type ImageManager ¶
type ImageManager interface { RecordContainerReference(container *api.Container) error RemoveContainerReferenceFromImageState(container *api.Container) error AddAllImageStates(imageStates []*image.ImageState) GetImageStateFromImageName(containerImageName string) *image.ImageState StartImageCleanupProcess(ctx context.Context) SetSaver(stateManager statemanager.Saver) }
ImageManager is responsible for saving the Image states, adding and removing container references to ImageStates
func NewImageManager ¶
func NewImageManager(cfg *config.Config, client DockerClient, state dockerstate.TaskEngineState) ImageManager
NewImageManager returns a new ImageManager
type ImageStatesForDeletion ¶
type ImageStatesForDeletion []*image.ImageState
ImageStatesForDeletion is used for implementing the sort interface
func (ImageStatesForDeletion) Len ¶
func (imageStates ImageStatesForDeletion) Len() int
Implementing sort interface based on last used times of the images
func (ImageStatesForDeletion) Less ¶
func (imageStates ImageStatesForDeletion) Less(i, j int) bool
func (ImageStatesForDeletion) Swap ¶
func (imageStates ImageStatesForDeletion) Swap(i, j int)
type ListContainersResponse ¶
ListContainersResponse encapsulates the response from the docker client for the ListContainers call.
type MockDockerClient ¶
type MockDockerClient struct {
// contains filtered or unexported fields
}
Mock of DockerClient interface
func NewMockDockerClient ¶
func NewMockDockerClient(ctrl *gomock.Controller) *MockDockerClient
func (*MockDockerClient) ContainerEvents ¶
func (_m *MockDockerClient) ContainerEvents(_param0 context.Context) (<-chan DockerContainerChangeEvent, error)
func (*MockDockerClient) CreateContainer ¶
func (_m *MockDockerClient) CreateContainer(_param0 *go_dockerclient.Config, _param1 *go_dockerclient.HostConfig, _param2 string, _param3 time.Duration) DockerContainerMetadata
func (*MockDockerClient) DescribeContainer ¶
func (_m *MockDockerClient) DescribeContainer(_param0 string) (api.ContainerStatus, DockerContainerMetadata)
func (*MockDockerClient) EXPECT ¶
func (_m *MockDockerClient) EXPECT() *_MockDockerClientRecorder
func (*MockDockerClient) ImportLocalEmptyVolumeImage ¶
func (_m *MockDockerClient) ImportLocalEmptyVolumeImage() DockerContainerMetadata
func (*MockDockerClient) InspectContainer ¶
func (_m *MockDockerClient) InspectContainer(_param0 string, _param1 time.Duration) (*go_dockerclient.Container, error)
func (*MockDockerClient) InspectImage ¶
func (_m *MockDockerClient) InspectImage(_param0 string) (*go_dockerclient.Image, error)
func (*MockDockerClient) KnownVersions ¶
func (_m *MockDockerClient) KnownVersions() []dockerclient.DockerVersion
func (*MockDockerClient) ListContainers ¶
func (_m *MockDockerClient) ListContainers(_param0 bool, _param1 time.Duration) ListContainersResponse
func (*MockDockerClient) PullImage ¶
func (_m *MockDockerClient) PullImage(_param0 string, _param1 *api.RegistryAuthenticationData) DockerContainerMetadata
func (*MockDockerClient) RemoveContainer ¶
func (_m *MockDockerClient) RemoveContainer(_param0 string, _param1 time.Duration) error
func (*MockDockerClient) RemoveImage ¶
func (_m *MockDockerClient) RemoveImage(_param0 string, _param1 time.Duration) error
func (*MockDockerClient) StartContainer ¶
func (_m *MockDockerClient) StartContainer(_param0 string, _param1 time.Duration) DockerContainerMetadata
func (*MockDockerClient) Stats ¶
func (_m *MockDockerClient) Stats(_param0 string, _param1 context.Context) (<-chan *go_dockerclient.Stats, error)
func (*MockDockerClient) StopContainer ¶
func (_m *MockDockerClient) StopContainer(_param0 string, _param1 time.Duration) DockerContainerMetadata
func (*MockDockerClient) SupportedVersions ¶
func (_m *MockDockerClient) SupportedVersions() []dockerclient.DockerVersion
func (*MockDockerClient) Version ¶
func (_m *MockDockerClient) Version() (string, error)
func (*MockDockerClient) WithVersion ¶
func (_m *MockDockerClient) WithVersion(_param0 dockerclient.DockerVersion) DockerClient
type MockImageManager ¶
type MockImageManager struct {
// contains filtered or unexported fields
}
Mock of ImageManager interface
func NewMockImageManager ¶
func NewMockImageManager(ctrl *gomock.Controller) *MockImageManager
func (*MockImageManager) AddAllImageStates ¶
func (_m *MockImageManager) AddAllImageStates(_param0 []*image.ImageState)
func (*MockImageManager) EXPECT ¶
func (_m *MockImageManager) EXPECT() *_MockImageManagerRecorder
func (*MockImageManager) GetImageStateFromImageName ¶
func (_m *MockImageManager) GetImageStateFromImageName(_param0 string) *image.ImageState
func (*MockImageManager) RecordContainerReference ¶
func (_m *MockImageManager) RecordContainerReference(_param0 *api.Container) error
func (*MockImageManager) RemoveContainerReferenceFromImageState ¶
func (_m *MockImageManager) RemoveContainerReferenceFromImageState(_param0 *api.Container) error
func (*MockImageManager) SetSaver ¶
func (_m *MockImageManager) SetSaver(_param0 statemanager.Saver)
func (*MockImageManager) StartImageCleanupProcess ¶
func (_m *MockImageManager) StartImageCleanupProcess(_param0 context0.Context)
type MockTaskEngine ¶
type MockTaskEngine struct {
// contains filtered or unexported fields
}
Mock of TaskEngine interface
func NewMockTaskEngine ¶
func NewMockTaskEngine(ctrl *gomock.Controller) *MockTaskEngine
func (*MockTaskEngine) Disable ¶
func (_m *MockTaskEngine) Disable()
func (*MockTaskEngine) EXPECT ¶
func (_m *MockTaskEngine) EXPECT() *_MockTaskEngineRecorder
func (*MockTaskEngine) GetTaskByArn ¶
func (_m *MockTaskEngine) GetTaskByArn(_param0 string) (*api.Task, bool)
func (*MockTaskEngine) MarshalJSON ¶
func (_m *MockTaskEngine) MarshalJSON() ([]byte, error)
func (*MockTaskEngine) MustInit ¶
func (_m *MockTaskEngine) MustInit(_param0 context0.Context)
func (*MockTaskEngine) SetSaver ¶
func (_m *MockTaskEngine) SetSaver(_param0 statemanager.Saver)
func (*MockTaskEngine) StateChangeEvents ¶
func (_m *MockTaskEngine) StateChangeEvents() chan statechange.Event
func (*MockTaskEngine) UnmarshalJSON ¶
func (_m *MockTaskEngine) UnmarshalJSON(_param0 []byte) error
func (*MockTaskEngine) Version ¶
func (_m *MockTaskEngine) Version() (string, error)
type OutOfMemoryError ¶
type OutOfMemoryError struct{}
OutOfMemoryError is a type for errors caused by running out of memory
func (OutOfMemoryError) Error ¶
func (err OutOfMemoryError) Error() string
func (OutOfMemoryError) ErrorName ¶
func (err OutOfMemoryError) ErrorName() string
ErrorName returns the name of the error
type TaskDependencyError ¶
type TaskDependencyError struct {
// contains filtered or unexported fields
}
TaskDependencyError is the error for task that dependencies can't be resolved
func (TaskDependencyError) Error ¶
func (err TaskDependencyError) Error() string
func (TaskDependencyError) ErrorName ¶
func (err TaskDependencyError) ErrorName() string
ErrorName is the name of the error
type TaskEngine ¶
type TaskEngine interface { Init(context.Context) error MustInit(context.Context) // Disable *must* only be called when this engine will no longer be used // (e.g. right before exiting down the process). It will irreversably stop // this task engine from processing new tasks Disable() // StateChangeEvents will provide information about tasks that have been previously // executed. Specifically, it will provide information when they reach // running or stopped, as well as providing portbinding and other metadata StateChangeEvents() chan statechange.Event SetSaver(statemanager.Saver) // AddTask adds a new task to the task engine and manages its container's // lifecycle. If it returns an error, the task was not added. AddTask(*api.Task) error // ListTasks lists all the tasks being managed by the TaskEngine. ListTasks() ([]*api.Task, error) // GetTaskByArn gets a managed task, given a task arn. GetTaskByArn(string) (*api.Task, bool) Version() (string, error) json.Marshaler json.Unmarshaler }
TaskEngine is an interface for the DockerTaskEngine
func NewTaskEngine ¶
func NewTaskEngine(cfg *config.Config, client DockerClient, credentialsManager credentials.Manager, containerChangeEventStream *eventstream.EventStream, imageManager ImageManager, state dockerstate.TaskEngineState) TaskEngine
NewTaskEngine returns a default TaskEngine
type TaskStoppedBeforePullBeginError ¶
type TaskStoppedBeforePullBeginError struct {
// contains filtered or unexported fields
}
TaskStoppedBeforePullBeginError is a type for task errors involving pull
func (TaskStoppedBeforePullBeginError) Error ¶
func (err TaskStoppedBeforePullBeginError) Error() string
func (TaskStoppedBeforePullBeginError) ErrorName ¶
func (TaskStoppedBeforePullBeginError) ErrorName() string
ErrorName returns the name of the error
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package dockerauth handles storing auth configuration information for Docker registries.
|
Package dockerauth handles storing auth configuration information for Docker registries. |
Package dockeriface contains an interface for go-dockerclient matching the subset used by the agent
|
Package dockeriface contains an interface for go-dockerclient matching the subset used by the agent |
testutils
Package testutils contains files that are used in tests but not elsewhere and thus can be excluded from the final executable.
|
Package testutils contains files that are used in tests but not elsewhere and thus can be excluded from the final executable. |
Package emptyvolume contains some information related to the 'emptyvolumes'
|
Package emptyvolume contains some information related to the 'emptyvolumes' |
Package testutils contains files that are used in tests but not elsewhere and thus can be excluded from the final executable.
|
Package testutils contains files that are used in tests but not elsewhere and thus can be excluded from the final executable. |