Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: record workflow topology to workflow run #1312

Merged
merged 1 commit into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/apis/cyclone/v1alpha1/workflow_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ type StageStatus struct {
Status Status `json:"status"`
// Key-value outputs of this stage
Outputs []KeyValue `json:"outputs"`
// Stages that this stage depends on.
Depends []string `json:"depends"`
// Trivial indicates whether this stage is critical in the workflow. If set to true, it means the workflow
// can tolerate failure of this stage. In this case, all other stages can continue to execute and the overall
// status of the workflow execution can still be succeed.
Trivial bool `json:"trivial"`
}

// StatusPhase represents the phase of stage status or workflowrun status.
Expand Down
4 changes: 3 additions & 1 deletion pkg/workflow/workflowrun/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (o *operator) GetRecorder() record.EventRecorder {
return o.recorder
}

// InitStagesStatus initializes all missing stages' status to pending.
// InitStagesStatus initializes all missing stages' status to pending, and record workflow topology at this time to workflowRun status.
func (o *operator) InitStagesStatus() {
if o.wfr.Status.Stages == nil {
o.wfr.Status.Stages = make(map[string]*v1alpha1.StageStatus)
Expand All @@ -131,6 +131,8 @@ func (o *operator) InitStagesStatus() {
Status: v1alpha1.Status{
Phase: v1alpha1.StatusPending,
},
Depends: stg.Depends,
Trivial: stg.Trivial,
}
}
}
Expand Down