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

WIP: Surface BuildRun Results List under Status #787

Closed
Closed
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
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"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about Results []Result, to match the yaml field name?


// 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