Documentation
¶
Index ¶
- Constants
- func GetCondition(wfe *workflowexecutionv1.WorkflowExecution, conditionType string) *metav1.Condition
- func IsConditionTrue(wfe *workflowexecutionv1.WorkflowExecution, conditionType string) bool
- func SetAuditRecorded(wfe *workflowexecutionv1.WorkflowExecution, succeeded bool, ...)
- func SetCondition(wfe *workflowexecutionv1.WorkflowExecution, conditionType string, ...)
- func SetExecutionComplete(wfe *workflowexecutionv1.WorkflowExecution, succeeded bool, ...)
- func SetExecutionCreated(wfe *workflowexecutionv1.WorkflowExecution, created bool, ...)
- func SetExecutionRunning(wfe *workflowexecutionv1.WorkflowExecution, running bool, ...)
- func SetReady(wfe *workflowexecutionv1.WorkflowExecution, ready bool, reason, message string)
Constants ¶
const ( // ConditionReady indicates the WorkflowExecution is ready (or not) ConditionReady = "Ready" // ConditionExecutionCreated indicates the execution resource (PipelineRun or Job) was created // Phase Alignment: Pending → Running transition // Set after successful creation of the execution resource ConditionExecutionCreated = "ExecutionCreated" // ConditionExecutionRunning indicates the execution resource (PipelineRun or Job) is executing // Phase Alignment: PhaseRunning // Set when execution resource reports active/running status ConditionExecutionRunning = "ExecutionRunning" // ConditionExecutionComplete indicates the execution resource (PipelineRun or Job) finished // Phase Alignment: PhaseCompleted OR PhaseFailed // Set when execution resource reaches terminal state (Succeeded/Failed) ConditionExecutionComplete = "ExecutionComplete" // ConditionAuditRecorded indicates audit event was written to Data Storage // Phase Alignment: All phases (cross-cutting concern) // Per BR-WE-005: WorkflowExecution is P0 for audit traces ConditionAuditRecorded = "AuditRecorded" )
Condition types for WorkflowExecution
const ( // ReasonExecutionCreated - Execution resource created successfully ReasonExecutionCreated = "ExecutionCreated" // ReasonExecutionCreationFailed - Execution resource creation failed ReasonExecutionCreationFailed = "ExecutionCreationFailed" // ReasonQuotaExceeded - Kubernetes resource quota exceeded ReasonQuotaExceeded = "QuotaExceeded" // ReasonRBACDenied - Insufficient RBAC permissions ReasonRBACDenied = "RBACDenied" // ReasonImagePullFailed - Container image pull failed ReasonImagePullFailed = "ImagePullFailed" )
Condition reasons for ExecutionCreated
const ( // ReasonExecutionStarted - Execution resource started ReasonExecutionStarted = "ExecutionStarted" // ReasonExecutionFailedToStart - Execution resource stuck in pending ReasonExecutionFailedToStart = "ExecutionFailedToStart" )
Condition reasons for ExecutionRunning
const ( // ReasonExecutionSucceeded - Execution completed successfully ReasonExecutionSucceeded = "ExecutionSucceeded" // ReasonExecutionFailed - Execution failed ReasonExecutionFailed = "ExecutionFailed" // ReasonTaskFailed - Tekton Task failed ReasonTaskFailed = "TaskFailed" // ReasonDeadlineExceeded - Pipeline timeout ReasonDeadlineExceeded = "DeadlineExceeded" // ReasonOOMKilled - Out of memory ReasonOOMKilled = "OOMKilled" )
Condition reasons for ExecutionComplete
const ( // ReasonAuditSucceeded - Audit event written to Data Storage ReasonAuditSucceeded = "AuditSucceeded" // ReasonAuditFailed - Audit write failed (Data Storage unavailable) ReasonAuditFailed = "AuditFailed" )
Condition reasons for AuditRecorded
const ( ReasonReady = "Ready" ReasonNotReady = "NotReady" )
Ready condition reasons
Variables ¶
This section is empty.
Functions ¶
func GetCondition ¶
func GetCondition(wfe *workflowexecutionv1.WorkflowExecution, conditionType string) *metav1.Condition
GetCondition returns the condition with the specified type, or nil if not found
This function delegates to pkg/shared/conditions.Get() for the actual implementation, ensuring consistent behavior across all services.
func IsConditionTrue ¶
func IsConditionTrue(wfe *workflowexecutionv1.WorkflowExecution, conditionType string) bool
IsConditionTrue returns true if the condition exists and has status True
This function delegates to pkg/shared/conditions.IsTrue() for the actual implementation, ensuring consistent behavior across all services.
func SetAuditRecorded ¶
func SetAuditRecorded(wfe *workflowexecutionv1.WorkflowExecution, succeeded bool, reason, message string)
SetAuditRecorded sets the AuditRecorded condition
Usage:
// Audit succeeded
SetAuditRecorded(wfe, true, ReasonAuditSucceeded,
"Audit event workflowexecution.workflow.completed recorded to DataStorage")
// Audit failed
SetAuditRecorded(wfe, false, ReasonAuditFailed,
"Failed to record audit event: DataStorage unavailable")
func SetCondition ¶
func SetCondition(wfe *workflowexecutionv1.WorkflowExecution, conditionType string, status metav1.ConditionStatus, reason, message string)
SetCondition sets or updates a condition on the WorkflowExecution status This is the low-level function used by all condition setters
This function delegates to pkg/shared/conditions.SetWithGeneration for the actual implementation, ensuring consistent behavior across all services and proper ObservedGeneration tracking.
func SetExecutionComplete ¶
func SetExecutionComplete(wfe *workflowexecutionv1.WorkflowExecution, succeeded bool, reason, message string)
SetExecutionComplete sets the ExecutionComplete condition
Usage:
// Execution succeeded
SetExecutionComplete(wfe, true, ReasonExecutionSucceeded,
"All tasks completed successfully in 45s")
// Execution failed
SetExecutionComplete(wfe, false, ReasonTaskFailed,
"Task apply-memory-increase failed: kubectl apply failed with exit code 1")
func SetExecutionCreated ¶
func SetExecutionCreated(wfe *workflowexecutionv1.WorkflowExecution, created bool, reason, message string)
SetExecutionCreated sets the ExecutionCreated condition
Usage:
// Success case
SetExecutionCreated(wfe, true, ReasonExecutionCreated,
fmt.Sprintf("Execution resource %s created in %s namespace", name, namespace))
// Failure case
SetExecutionCreated(wfe, false, ReasonQuotaExceeded,
"Failed to create execution resource: pods exceeded quota")
func SetExecutionRunning ¶
func SetExecutionRunning(wfe *workflowexecutionv1.WorkflowExecution, running bool, reason, message string)
SetExecutionRunning sets the ExecutionRunning condition
Usage:
// Execution started
SetExecutionRunning(wfe, true, ReasonExecutionStarted,
"Execution resource running (task 2 of 5)")
// Execution failed to start
SetExecutionRunning(wfe, false, ReasonExecutionFailedToStart,
"Execution resource stuck in pending: node pressure")
func SetReady ¶
func SetReady(wfe *workflowexecutionv1.WorkflowExecution, ready bool, reason, message string)
SetReady sets the Ready condition on the WorkflowExecution.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package audit provides audit trail management for WorkflowExecution.
|
Package audit provides audit trail management for WorkflowExecution. |
|
Package client provides clients for querying external services from the WFE controller.
|
Package client provides clients for querying external services from the WFE controller. |
|
Package config provides configuration types for the WorkflowExecution controller.
|
Package config provides configuration types for the WorkflowExecution controller. |
|
Package executor defines the Strategy pattern interface for workflow execution backends.
|
Package executor defines the Strategy pattern interface for workflow execution backends. |
|
Package metrics provides Prometheus metrics for workflow execution observability.
|
Package metrics provides Prometheus metrics for workflow execution observability. |
|
Package phase provides phase constants and state machine logic for WorkflowExecution.
|
Package phase provides phase constants and state machine logic for WorkflowExecution. |