Skip to content

Commit

Permalink
[TEP-114] Timeout Wait Custom Task
Browse files Browse the repository at this point in the history
Prior to this commit, wait custom task can only wait for a duration
of time. This commit adds a new functionality timeout to the custom
task controller "wait-task", so that we can test the behavior
of Custom Task Run time out.
  • Loading branch information
XinruZhang committed Aug 29, 2022
1 parent a1a8458 commit d44cef2
Show file tree
Hide file tree
Showing 5 changed files with 519 additions and 198 deletions.
6 changes: 5 additions & 1 deletion test/wait-task/cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
runreconciler "github.com/tektoncd/pipeline/pkg/client/injection/reconciler/pipeline/v1alpha1/run"
tkncontroller "github.com/tektoncd/pipeline/pkg/controller"
"github.com/tektoncd/pipeline/test/wait-task/pkg/reconciler"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/client-go/tools/cache"
"knative.dev/pkg/configmap"
"knative.dev/pkg/controller"
Expand All @@ -36,7 +37,10 @@ func main() {
}

func newController(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
c := &reconciler.Reconciler{}
c := &reconciler.Reconciler{
Clock: clock.RealClock{},
Recorder: controller.GetEventRecorder(ctx),
}
impl := runreconciler.NewImpl(ctx, c, func(impl *controller.Impl) controller.Options {
return controller.Options{
AgentName: controllerName,
Expand Down
9 changes: 5 additions & 4 deletions test/wait-task/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ module github.com/tektoncd/pipeline/test/wait-task
go 1.15

require (
github.com/tektoncd/pipeline v0.31.1-0.20220105002759-3e137645be61
k8s.io/apimachinery v0.22.5
k8s.io/client-go v0.22.5
knative.dev/pkg v0.0.0-20220104185830-52e42b760b54
github.com/tektoncd/pipeline v0.39.0
k8s.io/api v0.23.9 // indirect
k8s.io/apimachinery v0.23.9
k8s.io/client-go v0.23.9
knative.dev/pkg v0.0.0-20220805012121-7b8b06028e4f
)
Loading

0 comments on commit d44cef2

Please sign in to comment.