-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the event type string for taskruns from dev.tekton.event.task.* to dev.tekton.event.taskrun.*. Since cloud events are only sent by pipeline resources - which are alpha - we don't need to comply with the beta deprecation policy for this. Extend the cloudevents module to include more event types for TaskRuns and event types for PipelineRuns, with unit test coverage. This is achieved by introducing the RunsToCompletion and RunsToCompletionStatus interface which are met by TaskRun, PipelineRun and their respective status types. At this stage there is no event producer that generates these new events. This is preparing the stage for the next changes where we will start to emit cloud events in addition to the k8s events we emit today. Partially addresses #2082 Partially addresses #2684 Signed-off-by: Andrea Frittoli <[email protected]>
- Loading branch information
Showing
5 changed files
with
246 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
Copyright 2020 The Tekton Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1beta1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"knative.dev/pkg/apis" | ||
) | ||
|
||
// RunsToCompletionStatus is implemented by TaskRun.Status and PipelineRun.Status | ||
type RunsToCompletionStatus interface { | ||
GetCondition(t apis.ConditionType) *apis.Condition | ||
InitializeConditions() | ||
SetCondition(newCond *apis.Condition) | ||
} | ||
|
||
// RunsToCompletion is implemented by TaskRun and PipelineRun | ||
type RunsToCompletion interface { | ||
GetTypeMeta() *metav1.TypeMeta | ||
GetObjectMeta() *metav1.ObjectMeta | ||
GetOwnerReference() metav1.OwnerReference | ||
GetStatus() RunsToCompletionStatus | ||
IsDone() bool | ||
HasStarted() bool | ||
IsCancelled() bool | ||
HasTimedOut() bool | ||
GetRunKey() string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters