Documentation ¶
Index ¶
- Variables
- type WorkflowExecutor
- func (we *WorkflowExecutor) AddAnnotation(key, value string) error
- func (we *WorkflowExecutor) AddError(err error)
- func (we *WorkflowExecutor) AnnotateOutputs() error
- func (we *WorkflowExecutor) CaptureScriptResult() error
- func (we *WorkflowExecutor) ExecResource(action string, manifestPath string) (string, error)
- func (we *WorkflowExecutor) GetMainContainerID() (string, error)
- func (we *WorkflowExecutor) GetMainContainerStatus() (*apiv1.ContainerStatus, error)
- func (we *WorkflowExecutor) HandleError()
- func (we *WorkflowExecutor) InitDriver(art wfv1.Artifact) (artifact.ArtifactDriver, error)
- func (we *WorkflowExecutor) LoadArtifacts() error
- func (we *WorkflowExecutor) LoadExecutionControl() error
- func (we *WorkflowExecutor) LoadTemplate() error
- func (we *WorkflowExecutor) SaveArtifacts() error
- func (we *WorkflowExecutor) SaveParameters() error
- func (we *WorkflowExecutor) SaveResourceParameters(resourceName string) error
- func (we *WorkflowExecutor) StageFiles() error
- func (we *WorkflowExecutor) Wait() (err error)
- func (we *WorkflowExecutor) WaitResource(resourceName string) error
Constants ¶
This section is empty.
Variables ¶
var DefaultRetry = wait.Backoff{ Steps: 5, Duration: 10 * time.Millisecond, Factor: 1.0, Jitter: 0.1, }
DefaultRetry is a default retry backoff settings when retrying API calls
Functions ¶
This section is empty.
Types ¶
type WorkflowExecutor ¶
type WorkflowExecutor struct { PodName string Template wfv1.Template ClientSet kubernetes.Interface Namespace string PodAnnotationsPath string ExecutionControl *common.ExecutionControl // contains filtered or unexported fields }
WorkflowExecutor is program which runs as the init/wait container
func NewExecutor ¶
func NewExecutor(clientset kubernetes.Interface, podName, namespace, podAnnotationsPath string) WorkflowExecutor
NewExecutor instantiates a new workflow executor
func (*WorkflowExecutor) AddAnnotation ¶
func (we *WorkflowExecutor) AddAnnotation(key, value string) error
AddAnnotation adds an annotation to the workflow pod
func (*WorkflowExecutor) AddError ¶
func (we *WorkflowExecutor) AddError(err error)
AddError adds an error to the list of encountered errors durign execution
func (*WorkflowExecutor) AnnotateOutputs ¶
func (we *WorkflowExecutor) AnnotateOutputs() error
AnnotateOutputs annotation to the pod indicating all the outputs.
func (*WorkflowExecutor) CaptureScriptResult ¶
func (we *WorkflowExecutor) CaptureScriptResult() error
CaptureScriptResult will add the stdout of a script template as output result
func (*WorkflowExecutor) ExecResource ¶
func (we *WorkflowExecutor) ExecResource(action string, manifestPath string) (string, error)
ExecResource will run kubectl action against a manifest
func (*WorkflowExecutor) GetMainContainerID ¶
func (we *WorkflowExecutor) GetMainContainerID() (string, error)
GetMainContainerID returns the container id of the main container
func (*WorkflowExecutor) GetMainContainerStatus ¶
func (we *WorkflowExecutor) GetMainContainerStatus() (*apiv1.ContainerStatus, error)
GetMainContainerStatus returns the container status of the main container, nil if the main container does not exist
func (*WorkflowExecutor) HandleError ¶
func (we *WorkflowExecutor) HandleError()
HandleError is a helper to annotate the pod with the error message upon a unexpected executor panic or error
func (*WorkflowExecutor) InitDriver ¶
func (we *WorkflowExecutor) InitDriver(art wfv1.Artifact) (artifact.ArtifactDriver, error)
InitDriver initializes an instance of an artifact driver
func (*WorkflowExecutor) LoadArtifacts ¶
func (we *WorkflowExecutor) LoadArtifacts() error
LoadArtifacts loads aftifacts from location to a container path
func (*WorkflowExecutor) LoadExecutionControl ¶
func (we *WorkflowExecutor) LoadExecutionControl() error
LoadExecutionControl reads the execution control definition from the the Kubernetes downward api annotations volume file
func (*WorkflowExecutor) LoadTemplate ¶
func (we *WorkflowExecutor) LoadTemplate() error
LoadTemplate reads the template definition from the the Kubernetes downward api annotations volume file
func (*WorkflowExecutor) SaveArtifacts ¶
func (we *WorkflowExecutor) SaveArtifacts() error
SaveArtifacts uploads artifacts to the archive location
func (*WorkflowExecutor) SaveParameters ¶
func (we *WorkflowExecutor) SaveParameters() error
SaveParameters will save the content in the specified file path as output parameter value
func (*WorkflowExecutor) SaveResourceParameters ¶
func (we *WorkflowExecutor) SaveResourceParameters(resourceName string) error
SaveResourceParameters will save any resource output parameters
func (*WorkflowExecutor) StageFiles ¶
func (we *WorkflowExecutor) StageFiles() error
StageFiles will create any files required by script/resource templates
func (*WorkflowExecutor) Wait ¶
func (we *WorkflowExecutor) Wait() (err error)
Wait is the sidecar container logic which waits for the main container to complete. Also monitors for updates in the pod annotations which may change (e.g. terminate) Upon completion, kills any sidecars after it finishes.
func (*WorkflowExecutor) WaitResource ¶
func (we *WorkflowExecutor) WaitResource(resourceName string) error
WaitResource waits for a specific resource to satisfy either the success or failure condition