pipeline
pipeline copied to clipboard
Pipelinesruns status currently displays failed tasks but doesn't mention reason of failure and error encountered
Feature request
Pipelinesruns status currently displays failed tasks but doesn't mention reason of failure and error encountered. If there are two parallel tasks and both failed , pipelinerun just mentioned number of tasks failed and not the reasons.
Use case
Use case is to determine all failures that happens in pipelineruns under status.conditions.
// pkg/apis/pipeline/v1beta1/pipelinerun_types.go
package v1beta1
import (
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/pkg/apis"
duckv1 "knative.dev/pkg/apis/duck/v1"
)
// TaskRunFailureDetails captures the reason and error message for a failed TaskRun.
type TaskRunFailureDetails struct {
// TaskRunName is the name of the failed TaskRun.
TaskRunName string `json:"taskRunName"`
// Reason is the reason for the TaskRun failure (e.g., "TaskRunFailed", "CreateContainerConfigError").
Reason string `json:"reason"`
// Message is the detailed error message from the TaskRun's condition.
Message string `json:"message"`
}
// PipelineRunStatus defines the observed state of PipelineRun.
type PipelineRunStatus struct {
duckv1.Status `json:",inline"`
// StartTime is the time the PipelineRun is actually started.
// +optional
StartTime *metav1.Time `json:"startTime,omitempty"`
// CompletionTime is the time the PipelineRun completed.
// +optional
CompletionTime *metav1.Time `json:"completionTime,omitempty"`
// TaskRuns is a map from taskRun name to its status.
// +optional
TaskRuns map[string]*PipelineRunTaskRunStatus `json:"taskRuns,omitempty"`
// SkippedTasks is the list of tasks that were skipped.
// +optional
SkippedTasks []SkippedTask `json:"skippedTasks,omitempty"`
// ChildReferences holds references to TaskRuns and Runs.
// +optional
ChildReferences []ChildStatusReference `json:"childReferences,omitempty"`
// FailedTasks is a map of failed TaskRun names to their failure details (reason and message).
// +optional
FailedTasks []TaskRunFailureDetails `json:"failedTasks,omitempty"`
// Provenance contains metadata about resources used in the PipelineRun.
// +optional
Provenance Provenance `json:"provenance,omitempty"`
}
// PipelineRunStatusFields holds the fields of PipelineRun's status.
type PipelineRunStatusFields struct {
// StartTime is the time the PipelineRun is actually started.
// +optional
StartTime *metav1.Time `json:"startTime,omitempty"`
// CompletionTime is the time the PipelineRun completed.
// +optional
CompletionTime *metav1.Time `json:"completionTime,omitempty"`
// TaskRuns is a map from taskRun name to its status.
// +optional
TaskRuns map[string]*PipelineRunTaskRunStatus `json:"taskRuns,omitempty"`
// SkippedTasks is the list of tasks that were skipped.
// +optional
SkippedTasks []SkippedTask `json:"skippedTasks,omitempty"`
// ChildReferences holds references to TaskRuns and Runs.
// +optional
ChildReferences []ChildStatusReference `json:"childReferences,omitempty"`
// FailedTasks is a map of failed TaskRun names to their failure details (reason and message).
// +optional
FailedTasks []TaskRunFailureDetails `json:"failedTasks,omitempty"`
// Provenance contains metadata about resources used in the PipelineRun.
// +optional
Provenance Provenance `json:"provenance,omitempty"`
}