Documentation ¶
Index ¶
- type Coordinator
- func (co *Coordinator) CollectArtifacts() error
- func (co *Coordinator) CollectExecutionResults() error
- func (co *Coordinator) CollectLogs() error
- func (co *Coordinator) CollectResources() error
- func (co *Coordinator) GetExitCodes(selectors ...common.ContainerSelector) (map[string]int32, error)
- func (co *Coordinator) NotifyResolvers() error
- func (co *Coordinator) StageSuccess() bool
- func (co *Coordinator) WaitAllOthersTerminate() error
- func (co *Coordinator) WaitRunning() error
- func (co *Coordinator) WaitWorkloadTerminate() error
- func (co *Coordinator) WorkLoadSuccess() bool
- type RuntimeExecutor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coordinator ¶
type Coordinator struct { // Stage related to this pod. Stage *v1alpha1.Stage // Wfr represents the WorkflowRun which triggered this pod. Wfr *v1alpha1.WorkflowRun // OutputResources represents output resources the related stage configured. OutputResources []*v1alpha1.Resource // 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) (*Coordinator, error)
NewCoordinator create a coordinator instance.
func (*Coordinator) CollectArtifacts ¶
func (co *Coordinator) CollectArtifacts() error
CollectArtifacts collects workload artifacts.
func (*Coordinator) CollectExecutionResults ¶ added in v0.9.6
func (co *Coordinator) CollectExecutionResults() error
CollectExecutionResults collects execution results (key-values) and store them in pod's annotation
func (*Coordinator) CollectLogs ¶
func (co *Coordinator) CollectLogs() error
CollectLogs collects all containers' logs.
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)
GetExitCodes gets 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() error
WaitAllOthersTerminate waits all containers except for the coordinator container itself to become Terminated status.
func (*Coordinator) WaitRunning ¶
func (co *Coordinator) WaitRunning() error
WaitRunning waits all containers to start run.
func (*Coordinator) WaitWorkloadTerminate ¶
func (co *Coordinator) WaitWorkloadTerminate() error
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 waits selected containers to state. WaitContainers(state common.ContainerState, selectors ...common.ContainerSelector) error // CollectLog collects container logs to cyclone server. CollectLog(container, wrorkflowrun, stage string) error // CopyFromContainer copy a file or directory from container:path to dst. CopyFromContainer(container, path, dst string) error // GetPod get the stage related pod. GetPod() (*core_v1.Pod, error) // SetResults set results (key-values) to the pod, workflow controller would sync this result // to WorkflowRun status. SetResults(values []v1alpha1.KeyValue) error }
RuntimeExecutor is an interface defined some methods to communicate with k8s container runtime.