status

package
v1.32.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapTaskToContainerStatus

func MapTaskToContainerStatus(desiredState TaskStatus, steadyState apicontainerstatus.ContainerStatus) apicontainerstatus.ContainerStatus

MapTaskToContainerStatus maps the task status to the corresponding container status

Types

type TaskStatus

type TaskStatus int32

TaskStatus is an enumeration of valid states in the task lifecycle

const (
	// TaskStatusNone is the zero state of a task; this task has been received but no further progress has completed
	TaskStatusNone TaskStatus = iota
	// TaskPulled represents a task which has had all its container images pulled, but not all have yet progressed passed pull
	TaskPulled
	// TaskCreated represents a task which has had all its containers created
	TaskCreated
	// TaskRunning represents a task which has had all its containers started
	TaskRunning
	// TaskStopped represents a task in which all containers are stopped
	TaskStopped
	// TaskZombie is an "impossible" state that is used as the maximum
	TaskZombie
)

func MapContainerToTaskStatus

func MapContainerToTaskStatus(knownState apicontainerstatus.ContainerStatus, steadyState apicontainerstatus.ContainerStatus) TaskStatus

MapContainerToTaskStatus maps the container status to the corresponding task status. The transition map is illustrated below.

Container: None -> Pulled -> Created -> Running -> Provisioned -> Stopped -> Zombie

Task : None -> Created -> Running -> Stopped

func (*TaskStatus) BackendRecognized

func (ts *TaskStatus) BackendRecognized() bool

BackendRecognized returns true if the task status is recognized as a valid state by ECS. Note that not all task statuses are recognized by ECS or map to ECS states

func (*TaskStatus) BackendStatus

func (ts *TaskStatus) BackendStatus() string

BackendStatus maps the internal task status in the agent to that in the backend

func (*TaskStatus) MarshalJSON

func (ts *TaskStatus) MarshalJSON() ([]byte, error)

MarshalJSON overrides the logic for JSON-encoding the TaskStatus type

func (TaskStatus) String

func (ts TaskStatus) String() string

String returns a human readable string representation of this object

func (TaskStatus) Terminal

func (ts TaskStatus) Terminal() bool

Terminal returns true if the Task status is STOPPED

func (*TaskStatus) UnmarshalJSON

func (ts *TaskStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON overrides the logic for parsing the JSON-encoded TaskStatus data

Jump to

Keyboard shortcuts

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