Skip to content

Commit

Permalink
Add GetStatusCondition for Run
Browse files Browse the repository at this point in the history
The "Run" type does not have a GetStatusCondition which means it
doesn't fit the "objectWithCondition" interface used to send
cloudevents.

Add GetStatusCondition to make the type more consistent with
TaskRun and Pipelinerun and make it possible to use it as an
"objectWithCondition" when sending events.

Signed-off-by: Andrea Frittoli <[email protected]>
  • Loading branch information
afrittoli authored and tekton-robot committed Mar 10, 2022
1 parent 38d98f0 commit 71237ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/apis/pipeline/v1alpha1/run_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ type RunList struct {
Items []Run `json:"items"`
}

// GetStatusCondition returns the task run status as a ConditionAccessor
func (r *Run) GetStatusCondition() apis.ConditionAccessor {
return &r.Status
}

// GetGroupVersionKind implements kmeta.OwnerRefable.
func (*Run) GetGroupVersionKind() schema.GroupVersionKind {
return SchemeGroupVersion.WithKind(pipeline.RunControllerName)
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/events/cloudevent/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"knative.dev/pkg/apis"
)

// objectWithCondition is implemented by TaskRun and PipelineRun
// objectWithCondition is implemented by TaskRun, PipelineRun and Run
type objectWithCondition interface {

// Object requires GetObjectKind() and DeepCopyObject()
Expand Down

0 comments on commit 71237ba

Please sign in to comment.