Skip to content

Commit

Permalink
WIP add buildrun results list under status
Browse files Browse the repository at this point in the history
  • Loading branch information
qu1queee committed Jun 17, 2021
1 parent ea7a886 commit 4777c31
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/apis/build/v1alpha1/buildrun_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ type BuildRunStatus struct {
// +optional
LatestTaskRunRef *string `json:"latestTaskRunRef,omitempty"`

BuildResults []BuildResult `json:"results,omitempty"`

// StartTime is the time the build is actually started.
// +optional
StartTime *metav1.Time `json:"startTime,omitempty"`
Expand All @@ -71,6 +73,11 @@ type BuildRunStatus struct {
FailedAt *FailedAt `json:"failedAt,omitempty"`
}

type BuildResult struct {
Name string `json:"name"`
Value string `json:"value"`
}

// FailedAt describes the location where the failure happened
type FailedAt struct {
Pod string `json:"pod,omitempty"`
Expand Down
21 changes: 21 additions & 0 deletions pkg/apis/build/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkg/reconciler/buildrun/buildrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ func (r *ReconcileBuildRun) Reconcile(request reconcile.Request) (reconcile.Resu
} else if apierrors.IsNotFound(err) {
return reconcile.Result{}, nil
}
// TODO: quick test
for _, r := range lastTaskRun.Status.TaskRunResults {
buildRun.Status.BuildResults = append(buildRun.Status.BuildResults, buildv1alpha1.BuildResult{
Name: r.Name,
Value: r.Value,
})
}

// Check if the BuildRun is already finished, this happens if the build controller is restarted.
// It then reconciles all TaskRuns. This is valuable if the build controller was down while the TaskRun
Expand Down

0 comments on commit 4777c31

Please sign in to comment.