Documentation ¶
Index ¶
- Constants
- func FormatError(cmd *exec.Cmd, stdout []byte, err error) error
- func ToContainerState(state *types.ContainerState) *v1alpha1.DockerContainerState
- func ToHealthcheckOutput(state *types.ContainerState) string
- func ToServiceStatus(id container.ID, name string, state *types.ContainerState, ports nat.PortMap) v1alpha1.DockerComposeServiceStatus
- type Attributes
- type DockerComposeClient
- type DownCall
- type Event
- type FakeDCClient
- func (c *FakeDCClient) Config(_ context.Context, _ []string) (string, error)
- func (c *FakeDCClient) ContainerID(ctx context.Context, spec v1alpha1.DockerComposeServiceSpec) (container.ID, error)
- func (c *FakeDCClient) Down(ctx context.Context, proj v1alpha1.DockerComposeProject, ...) error
- func (c *FakeDCClient) DownCalls() []DownCall
- func (c *FakeDCClient) Project(_ context.Context, m v1alpha1.DockerComposeProject) (*types.Project, error)
- func (c *FakeDCClient) Rm(ctx context.Context, specs []v1alpha1.DockerComposeServiceSpec, ...) error
- func (c *FakeDCClient) RmCalls() []RmCall
- func (c *FakeDCClient) SendEvent(evt Event) error
- func (c *FakeDCClient) StreamEvents(ctx context.Context, p v1alpha1.DockerComposeProject) (<-chan string, error)
- func (c *FakeDCClient) Up(ctx context.Context, spec v1alpha1.DockerComposeServiceSpec, shouldBuild bool, ...) error
- func (c *FakeDCClient) UpCalls() []UpCall
- func (c *FakeDCClient) Version(_ context.Context) (string, string, error)
- type RmCall
- type State
- func (s State) HasEverBeenReadyOrSucceeded() bool
- func (State) RuntimeState()
- func (s State) RuntimeStatus() v1alpha1.RuntimeStatus
- func (s State) RuntimeStatusError() error
- func (s State) WithContainerID(cID container.ID) State
- func (s State) WithContainerState(state v1alpha1.DockerContainerState) State
- func (s State) WithPorts(ports []v1alpha1.DockerPortBinding) State
- func (s State) WithSpanID(spanID model.LogSpanID) State
- type Type
- type UpCall
Constants ¶
View Source
const ContainerStatusCreated = "created"
Status strings taken from comments on: https://godoc.org/github.com/docker/docker/api/types#ContainerState
View Source
const ContainerStatusDead = "dead"
View Source
const ContainerStatusExited = "exited"
View Source
const ContainerStatusPaused = "paused"
View Source
const ContainerStatusRemoving = "removing"
View Source
const ContainerStatusRestarting = "restarting"
View Source
const ContainerStatusRunning = "running"
View Source
const ZeroTime = "0001-01-01T00:00:00Z"
Helper functions for dealing with ContainerState.
Variables ¶
This section is empty.
Functions ¶
func ToContainerState ¶ added in v0.26.0
func ToContainerState(state *types.ContainerState) *v1alpha1.DockerContainerState
Convert ContainerState into an apiserver-compatible state model.
func ToHealthcheckOutput ¶ added in v0.33.18
func ToHealthcheckOutput(state *types.ContainerState) string
Returns the output of a healthcheck if the container is unhealthy.
func ToServiceStatus ¶ added in v0.26.0
func ToServiceStatus(id container.ID, name string, state *types.ContainerState, ports nat.PortMap) v1alpha1.DockerComposeServiceStatus
Convert a full into an apiserver-compatible status model.
Types ¶
type Attributes ¶
type DockerComposeClient ¶
type DockerComposeClient interface { Up(ctx context.Context, spec v1alpha1.DockerComposeServiceSpec, shouldBuild bool, stdout, stderr io.Writer) error Down(ctx context.Context, spec v1alpha1.DockerComposeProject, stdout, stderr io.Writer) error Rm(ctx context.Context, specs []v1alpha1.DockerComposeServiceSpec, stdout, stderr io.Writer) error StreamEvents(ctx context.Context, spec v1alpha1.DockerComposeProject) (<-chan string, error) Project(ctx context.Context, spec v1alpha1.DockerComposeProject) (*types.Project, error) ContainerID(ctx context.Context, spec v1alpha1.DockerComposeServiceSpec) (container.ID, error) Version(ctx context.Context) (canonicalVersion string, build string, err error) }
func NewDockerComposeClient ¶
func NewDockerComposeClient(lenv docker.LocalEnv) DockerComposeClient
TODO(dmiller): we might want to make this take a path to the docker-compose config so we don't have to keep passing it in.
type DownCall ¶ added in v0.23.5
type DownCall struct {
Proj v1alpha1.DockerComposeProject
}
Represents a single call to Down
type Event ¶
type Event struct { Time string `json:"time"` // todo: time Type Type `json:"type"` Action string `json:"action"` ID string `json:"id"` // todo: type? Service string `json:"service"` Attributes Attributes `json:"attributes"` }
func EventFromJsonStr ¶
type FakeDCClient ¶
type FakeDCClient struct { ContainerIDDefault container.ID ContainerIDByService map[string]container.ID ConfigOutput string VersionOutput string DownError error RmError error RmOutput string WorkDir string // contains filtered or unexported fields }
func NewFakeDockerComposeClient ¶
func NewFakeDockerComposeClient(t *testing.T, ctx context.Context) *FakeDCClient
func (*FakeDCClient) ContainerID ¶ added in v0.5.1
func (c *FakeDCClient) ContainerID(ctx context.Context, spec v1alpha1.DockerComposeServiceSpec) (container.ID, error)
func (*FakeDCClient) Down ¶
func (c *FakeDCClient) Down(ctx context.Context, proj v1alpha1.DockerComposeProject, stdout, stderr io.Writer) error
func (*FakeDCClient) DownCalls ¶ added in v0.23.5
func (c *FakeDCClient) DownCalls() []DownCall
func (*FakeDCClient) Project ¶ added in v0.22.1
func (c *FakeDCClient) Project(_ context.Context, m v1alpha1.DockerComposeProject) (*types.Project, error)
func (*FakeDCClient) Rm ¶ added in v0.23.5
func (c *FakeDCClient) Rm(ctx context.Context, specs []v1alpha1.DockerComposeServiceSpec, stdout, stderr io.Writer) error
func (*FakeDCClient) RmCalls ¶ added in v0.23.5
func (c *FakeDCClient) RmCalls() []RmCall
func (*FakeDCClient) SendEvent ¶
func (c *FakeDCClient) SendEvent(evt Event) error
func (*FakeDCClient) StreamEvents ¶
func (c *FakeDCClient) StreamEvents(ctx context.Context, p v1alpha1.DockerComposeProject) (<-chan string, error)
func (*FakeDCClient) Up ¶
func (c *FakeDCClient) Up(ctx context.Context, spec v1alpha1.DockerComposeServiceSpec, shouldBuild bool, stdout, stderr io.Writer) error
func (*FakeDCClient) UpCalls ¶ added in v0.6.0
func (c *FakeDCClient) UpCalls() []UpCall
type RmCall ¶ added in v0.23.5
type RmCall struct {
Specs []v1alpha1.DockerComposeServiceSpec
}
type State ¶
type State struct { ContainerState v1alpha1.DockerContainerState ContainerID container.ID Ports []v1alpha1.DockerPortBinding LastReadyTime time.Time SpanID model.LogSpanID }
func (State) HasEverBeenReadyOrSucceeded ¶ added in v0.14.0
func (State) RuntimeState ¶ added in v0.10.5
func (State) RuntimeState()
func (State) RuntimeStatus ¶ added in v0.14.0
func (s State) RuntimeStatus() v1alpha1.RuntimeStatus
func (State) RuntimeStatusError ¶ added in v0.14.0
func (State) WithContainerID ¶ added in v0.5.0
func (State) WithContainerState ¶ added in v0.14.0
func (s State) WithContainerState(state v1alpha1.DockerContainerState) State
type Type ¶
type Type int
https://docs.docker.com/engine/reference/commandline/events/
func (Type) MarshalJSON ¶ added in v0.4.3
func (*Type) UnmarshalJSON ¶
type UpCall ¶ added in v0.6.0
type UpCall struct { Spec v1alpha1.DockerComposeServiceSpec ShouldBuild bool }
Represents a single call to Up
Click to show internal directories.
Click to hide internal directories.