Skip to content

Commit 932091a

Browse files
khrmtekton-robot
authored andcommitted
Enable Finalizer for Pruner - Grace Period Config
Finalizer was disabled earlier for pruner setting, this enables it.
1 parent a3d212b commit 932091a

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

pkg/watcher/reconciler/dynamic/dynamic.go

-4
Original file line numberDiff line numberDiff line change
@@ -722,10 +722,6 @@ func (r *Reconciler) addStoredAnnotations(ctx context.Context, o results.Object)
722722
return nil
723723
}
724724

725-
if r.cfg.GetCompletedResourceGracePeriod() != 0*time.Second {
726-
logger.Debugf("Skipping CRD annotation patch: CompletedResourceGracePeriod is disabled ObjectName: %s", o.GetName())
727-
return nil
728-
}
729725
if r.cfg.GetDisableAnnotationUpdate() { //nolint:gocritic
730726
logger.Debug("Skipping CRD annotation patch: annotation update is disabled")
731727
return nil

pkg/watcher/reconciler/pipelinerun/reconciler.go

-6
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,6 @@ func (r *Reconciler) FinalizeKind(ctx context.Context, pr *pipelinev1.PipelineRu
144144
return nil
145145
}
146146

147-
// If the completed resource grace period isn't 0, we can't use finalizers
148-
// to coordinate deletion because a results pruner is running.
149-
if r.cfg.GetCompletedResourceGracePeriod() != 0*time.Second {
150-
return nil
151-
}
152-
153147
// Check to make sure the PipelineRun is finished.
154148
if !pr.IsDone() {
155149
logging.FromContext(ctx).Debugf("pipelinerun %s/%s is still running", pr.Namespace, pr.Name)

pkg/watcher/reconciler/taskrun/reconciler.go

-6
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ func (r *Reconciler) FinalizeKind(ctx context.Context, tr *pipelinev1.TaskRun) k
7878
return nil
7979
}
8080

81-
// If the completed resource grace period isn't 0, we can't use finalizers
82-
// to coordinate deletion because a results pruner is running.
83-
if r.cfg.GetCompletedResourceGracePeriod() != 0*time.Second {
84-
return nil
85-
}
86-
8781
// Check the TaskRun has finished.
8882
if !tr.IsDone() {
8983
logging.FromContext(ctx).Debugf("taskrun %s/%s is still running", tr.Namespace, tr.Name)

test/e2e/kustomize/watcher.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@
1818
- op: add
1919
path: "/spec/template/spec/containers/0/args/-"
2020
value: "15s"
21+
- op: add
22+
path: "/spec/template/spec/containers/0/args/-"
23+
value: "-store_deadline"
24+
- op: add
25+
path: "/spec/template/spec/containers/0/args/-"
26+
value: "20s"
27+
- op: add
28+
path: "/spec/template/spec/containers/0/args/-"
29+
value: "-forward_buffer"
30+
- op: add
31+
path: "/spec/template/spec/containers/0/args/-"
32+
value: "17s"
2133
- op: add
2234
path: "/spec/template/spec/containers/0/args/-"
2335
value: "-store_event=true"

0 commit comments

Comments
 (0)