Documentation ¶
Index ¶
- type Coordinator
- func (co *Coordinator) CollectArtifacts() error
- func (co *Coordinator) CollectLogs()
- 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()
- func (co *Coordinator) WaitRunning()
- func (co *Coordinator) WaitWorkloadTerminate()
- 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 relate 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) 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)
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()
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 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) }
RuntimeExecutor is an interface defined some methods to communicate with k8s container runtime.