coordinator

package
v0.9.2-beta Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

type Coordinator struct {

	// Stage which this run pod belonged to.
	Stage *v1alpha1.Stage
	// WorkflowRun which triggered this run pod.
	Wfr *v1alpha1.WorkflowRun
	// Event recorder.
	Recorder record.EventRecorder
	// contains filtered or unexported fields
}

Coordinator is a struct which contains infomations will be used in workflow sidecar named coordinator.

func NewCoordinator

func NewCoordinator(client clientset.Interface, kubecfg string) (*Coordinator, error)

NewCoordinator create a coordinator instance.

func (*Coordinator) CollectArtifacts

func (co *Coordinator) CollectArtifacts() error

CollectArtifacts collects workload artifacts.

func (*Coordinator) CollectLogs

func (co *Coordinator) CollectLogs()

CollectLogs collects all containers' logs except for the coordinator container itself.

func (*Coordinator) CollectResources

func (co *Coordinator) CollectResources() error

CollectResources collects workload resources.

func (*Coordinator) GetExitCodes

func (co *Coordinator) GetExitCodes(selectors ...common.ContainerSelector) (map[string]int32, error)

Get exit codes of containers passed the selector

func (*Coordinator) NotifyResolvers

func (co *Coordinator) NotifyResolvers() error

NotifyResolvers create a file to notify output resolvers to start working.

func (*Coordinator) StageSuccess

func (co *Coordinator) StageSuccess() bool

StageSuccess checks if the workload and resolver containers are succeeded.

func (*Coordinator) WaitAllOthersTerminate

func (co *Coordinator) WaitAllOthersTerminate()

WaitAllOthersTerminate waits all containers except for the coordinator container itself to become Terminated status.

func (*Coordinator) WaitRunning

func (co *Coordinator) WaitRunning()

WaitRunning waits all containers to start run.

func (*Coordinator) WaitWorkloadTerminate

func (co *Coordinator) WaitWorkloadTerminate()

WaitWorkloadTerminate waits all workload containers to be Terminated status.

func (*Coordinator) WorkLoadSuccess

func (co *Coordinator) WorkLoadSuccess() bool

WorkLoadSuccess checks if the workload containers are succeeded.

type RuntimeExecutor

type RuntimeExecutor interface {
	WaitContainers(state common.ContainerState, selectors ...common.ContainerSelector) error
	CollectLog(container, wrorkflowrun, stage string) error
	CopyFromContainer(container, path, dst string) error
	GetPod() (*core_v1.Pod, error)
	GetResource(name string) (*v1alpha1.Resource, error)
}

RuntimeExecutor is an interface defined some methods to communicate with k8s container runtime.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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