Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop the tracker. #4111

Merged
merged 1 commit into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pkg/reconciler/pipelinerun/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import (
"knative.dev/pkg/controller"
"knative.dev/pkg/kmeta"
"knative.dev/pkg/logging"
"knative.dev/pkg/tracker"
)

// NewController instantiates a new controller.Impl from knative.dev/pkg/controller
Expand Down Expand Up @@ -99,7 +98,6 @@ func NewController(namespace string, images pipeline.Images) func(context.Contex
logger.Info("Setting up event handlers")
pipelineRunInformer.Informer().AddEventHandler(controller.HandleAll(impl.Enqueue))

c.tracker = tracker.New(impl.EnqueueKey, 30*time.Minute)
taskRunInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
FilterFunc: controller.FilterController(&v1beta1.PipelineRun{}),
Handler: controller.HandleAll(impl.EnqueueControllerOf),
Expand Down
12 changes: 0 additions & 12 deletions pkg/reconciler/pipelinerun/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ import (
"knative.dev/pkg/kmeta"
"knative.dev/pkg/logging"
pkgreconciler "knative.dev/pkg/reconciler"
"knative.dev/pkg/tracker"
)

const (
Expand Down Expand Up @@ -129,7 +128,6 @@ type Reconciler struct {
resourceLister resourcelisters.PipelineResourceLister
conditionLister listersv1alpha1.ConditionLister
cloudEventClient cloudevent.CEClient
tracker tracker.Interface
metrics *Recorder
pvcHandler volumeclaim.PvcHandler

Expand Down Expand Up @@ -215,16 +213,6 @@ func (c *Reconciler) ReconcileKind(ctx context.Context, pr *v1beta1.PipelineRun)
return c.finishReconcileUpdateEmitEvents(ctx, pr, before, err)
}

if err := c.tracker.TrackReference(tracker.Reference{
APIVersion: v1beta1.SchemeGroupVersion.String(),
Kind: "TaskRun",
Namespace: pr.GetNamespace(),
Name: pr.GetName(),
}, pr); err != nil {
logger.Errorf("Failed to create tracker for TaskRuns for PipelineRun %s: %v", pr.Name, err)
return c.finishReconcileUpdateEmitEvents(ctx, pr, before, err)
}

// Make sure that the PipelineRun status is in sync with the actual TaskRuns
err = c.updatePipelineRunStatusFromInformer(ctx, pr)
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions pkg/reconciler/taskrun/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import (
"knative.dev/pkg/controller"
"knative.dev/pkg/kmeta"
"knative.dev/pkg/logging"
"knative.dev/pkg/tracker"
)

// NewController instantiates a new controller.Impl from knative.dev/pkg/controller
Expand Down Expand Up @@ -97,8 +96,6 @@ func NewController(namespace string, images pipeline.Images) func(context.Contex
logger.Info("Setting up event handlers")
taskRunInformer.Informer().AddEventHandler(controller.HandleAll(impl.Enqueue))

c.tracker = tracker.New(impl.EnqueueKey, controller.GetTrackerLease(ctx))

podInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
FilterFunc: controller.FilterGroupKind(v1beta1.Kind("TaskRun")),
Handler: controller.HandleAll(impl.EnqueueControllerOf),
Expand Down
12 changes: 0 additions & 12 deletions pkg/reconciler/taskrun/taskrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import (
"knative.dev/pkg/kmeta"
"knative.dev/pkg/logging"
pkgreconciler "knative.dev/pkg/reconciler"
"knative.dev/pkg/tracker"
)

// Reconciler implements controller.Reconciler for Configuration resources.
Expand All @@ -70,7 +69,6 @@ type Reconciler struct {
clusterTaskLister listers.ClusterTaskLister
resourceLister resourcelisters.PipelineResourceLister
cloudEventClient cloudevent.CEClient
tracker tracker.Interface
entrypointCache podconvert.EntrypointCache
metrics *Recorder
pvcHandler volumeclaim.PvcHandler
Expand Down Expand Up @@ -442,16 +440,6 @@ func (c *Reconciler) reconcile(ctx context.Context, tr *v1beta1.TaskRun, rtr *re
}
}

if err := c.tracker.TrackReference(tracker.Reference{
APIVersion: "v1",
Kind: "Pod",
Namespace: tr.Namespace,
Name: tr.Name,
}, tr); err != nil {
logger.Errorf("Failed to create tracker for build pod %q for taskrun %q: %v", tr.Name, tr.Name, err)
return err
}

if podconvert.IsPodExceedingNodeResources(pod) {
recorder.Eventf(tr, corev1.EventTypeWarning, podconvert.ReasonExceededNodeResources, "Insufficient resources to schedule pod %q", pod.Name)
}
Expand Down