Skip to content

Commit

Permalink
another
Browse files Browse the repository at this point in the history
  • Loading branch information
qu1queee committed Jan 22, 2024
1 parent 7da20f5 commit d996e37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
23 changes: 9 additions & 14 deletions pkg/apis/build/v1beta1/buildrun_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,17 @@ func (src *BuildRun) ConvertTo(ctx context.Context, obj *unstructured.Unstructur
conditions = append(conditions, ct)
}

var failureDetails v1alpha1.FailureDetails
alphaBuildRun.Status = v1alpha1.BuildRunStatus{
Sources: sourceStatus,
Output: (*v1alpha1.Output)(src.Status.Output),
Conditions: conditions,
LatestTaskRunRef: src.Status.TaskRunName,
StartTime: src.Status.StartTime,
CompletionTime: src.Status.CompletionTime,
}

if src.Status.FailureDetails != nil {
failureDetails = v1alpha1.FailureDetails{
alphaBuildRun.Status.FailureDetails = &v1alpha1.FailureDetails{
Reason: src.Status.FailureDetails.Reason,
Message: src.Status.FailureDetails.Message,
Location: &v1alpha1.FailedAt{
Expand All @@ -148,18 +155,6 @@ func (src *BuildRun) ConvertTo(ctx context.Context, obj *unstructured.Unstructur
}
}

alphaBuildRun.Status = v1alpha1.BuildRunStatus{
Sources: sourceStatus,
Output: (*v1alpha1.Output)(src.Status.Output),
Conditions: conditions,
LatestTaskRunRef: src.Status.TaskRunName,
StartTime: src.Status.StartTime,
CompletionTime: src.Status.CompletionTime,
FailureDetails: &failureDetails,
}

// TODO: add test case

aux := &v1alpha1.BuildSpec{}
if src.Status.BuildSpec != nil {
src.Status.BuildSpec.ConvertTo(aux)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
name: buildah-custom-context-dockerfile
spec:
source:
type: Git
git:
url: https://github.com/shipwright-io/sample-nodejs
contextDir: docker-build-renamed
Expand Down

0 comments on commit d996e37

Please sign in to comment.