Skip to content

Commit

Permalink
Enable Finalizer for Pruner - Grace Period Config
Browse files Browse the repository at this point in the history
Finalizer was disabled earlier for pruner setting, this enables it.
  • Loading branch information
khrm authored and tekton-robot committed Nov 19, 2024
1 parent a3d212b commit 932091a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
4 changes: 0 additions & 4 deletions pkg/watcher/reconciler/dynamic/dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,10 +722,6 @@ func (r *Reconciler) addStoredAnnotations(ctx context.Context, o results.Object)
return nil
}

if r.cfg.GetCompletedResourceGracePeriod() != 0*time.Second {
logger.Debugf("Skipping CRD annotation patch: CompletedResourceGracePeriod is disabled ObjectName: %s", o.GetName())
return nil
}
if r.cfg.GetDisableAnnotationUpdate() { //nolint:gocritic
logger.Debug("Skipping CRD annotation patch: annotation update is disabled")
return nil
Expand Down
6 changes: 0 additions & 6 deletions pkg/watcher/reconciler/pipelinerun/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,6 @@ func (r *Reconciler) FinalizeKind(ctx context.Context, pr *pipelinev1.PipelineRu
return nil
}

// If the completed resource grace period isn't 0, we can't use finalizers
// to coordinate deletion because a results pruner is running.
if r.cfg.GetCompletedResourceGracePeriod() != 0*time.Second {
return nil
}

// Check to make sure the PipelineRun is finished.
if !pr.IsDone() {
logging.FromContext(ctx).Debugf("pipelinerun %s/%s is still running", pr.Namespace, pr.Name)
Expand Down
6 changes: 0 additions & 6 deletions pkg/watcher/reconciler/taskrun/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ func (r *Reconciler) FinalizeKind(ctx context.Context, tr *pipelinev1.TaskRun) k
return nil
}

// If the completed resource grace period isn't 0, we can't use finalizers
// to coordinate deletion because a results pruner is running.
if r.cfg.GetCompletedResourceGracePeriod() != 0*time.Second {
return nil
}

// Check the TaskRun has finished.
if !tr.IsDone() {
logging.FromContext(ctx).Debugf("taskrun %s/%s is still running", tr.Namespace, tr.Name)
Expand Down
12 changes: 12 additions & 0 deletions test/e2e/kustomize/watcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
- op: add
path: "/spec/template/spec/containers/0/args/-"
value: "15s"
- op: add
path: "/spec/template/spec/containers/0/args/-"
value: "-store_deadline"
- op: add
path: "/spec/template/spec/containers/0/args/-"
value: "20s"
- op: add
path: "/spec/template/spec/containers/0/args/-"
value: "-forward_buffer"
- op: add
path: "/spec/template/spec/containers/0/args/-"
value: "17s"
- op: add
path: "/spec/template/spec/containers/0/args/-"
value: "-store_event=true"
Expand Down

0 comments on commit 932091a

Please sign in to comment.