-
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.
update func Reconcile, Reconciler struct, pipelinerun_expired, taskrun_expired and controller.
- Loading branch information
Showing
15 changed files
with
151 additions
and
164 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -32,7 +32,6 @@ import ( | |
cloudeventclient "github.com/tektoncd/pipeline/pkg/reconciler/taskrun/resources/cloudevent" | ||
"k8s.io/apimachinery/pkg/util/clock" | ||
"k8s.io/client-go/tools/cache" | ||
"k8s.io/client-go/util/workqueue" | ||
kubeclient "knative.dev/pkg/client/injection/kube/client" | ||
podinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/pod" | ||
"knative.dev/pkg/configmap" | ||
|
@@ -78,8 +77,6 @@ func NewController(images pipeline.Images) func(context.Context, configmap.Watch | |
timeoutHandler: timeoutHandler, | ||
cloudEventClient: cloudeventclient.Get(ctx), | ||
metrics: metrics, | ||
//recorder: eventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "ttl-after-finished-controller"}), | ||
queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "ttl_taskruns_to_delete"), | ||
} | ||
impl := controller.NewImpl(c, c.Logger, taskRunControllerName) | ||
|
||
|
@@ -92,27 +89,9 @@ func NewController(images pipeline.Images) func(context.Context, configmap.Watch | |
UpdateFunc: controller.PassNew(impl.Enqueue), | ||
}) | ||
|
||
AddTaskRun := func(obj interface{}) { | ||
tr := obj.(*v1alpha1.TaskRun) | ||
c.Logger.Infof("Adding TaskRun %s/%s", tr.Namespace, tr.Name) | ||
|
||
if tr.DeletionTimestamp == nil && taskRunCleanup(tr) { | ||
impl.Enqueue(tr) | ||
} | ||
} | ||
|
||
UpdateTaskRun := func(old, cur interface{}) { | ||
tr := cur.(*v1alpha1.TaskRun) | ||
c.Logger.Infof("Updating TaskRun %s/%s", tr.Namespace, tr.Name) | ||
|
||
if tr.DeletionTimestamp == nil && taskRunCleanup(tr) { | ||
impl.Enqueue(tr) | ||
} | ||
} | ||
|
||
taskRunInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ | ||
AddFunc: AddTaskRun, | ||
UpdateFunc: UpdateTaskRun, | ||
AddFunc: c.AddTaskRun, | ||
UpdateFunc: c.UpdateTaskRun, | ||
This comment has been minimized.
Sorry, something went wrong.
anxinyf
Author
|
||
}) | ||
|
||
c.taskRunLister = taskRunInformer.Lister() | ||
|
Oops, something went wrong.
The ExpirationTime will not exist with this PR, maybe next :)