Skip to content

Commit 1ad2f00

Browse files
committed
Implementing RecoverPanic on reconcilers to ensure it recovers from panic instead of crashing the controller and Squashed commits.
Signed-off-by: Santosh Kaluskar <[email protected]>
1 parent 02ff549 commit 1ad2f00

File tree

6 files changed

+6
-0
lines changed

6 files changed

+6
-0
lines changed

controllers/bucket_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ func (r *BucketReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts Buc
241241
WithOptions(controller.Options{
242242
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
243243
RateLimiter: opts.RateLimiter,
244+
RecoverPanic: true,
244245
}).
245246
Complete(r)
246247
}

controllers/gitrepository_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ func (r *GitRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, o
156156
WithOptions(controller.Options{
157157
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
158158
RateLimiter: opts.RateLimiter,
159+
RecoverPanic: true,
159160
}).
160161
Complete(r)
161162
}

controllers/helmchart_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ func (r *HelmChartReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts
176176
WithOptions(controller.Options{
177177
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
178178
RateLimiter: opts.RateLimiter,
179+
RecoverPanic: true,
179180
}).
180181
Complete(r)
181182
}

controllers/helmrepository_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ func (r *HelmRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager,
142142
WithOptions(controller.Options{
143143
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
144144
RateLimiter: opts.RateLimiter,
145+
RecoverPanic: true,
145146
}).
146147
Complete(r)
147148
}

controllers/helmrepository_controller_oci.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ func (r *HelmRepositoryOCIReconciler) SetupWithManagerAndOptions(mgr ctrl.Manage
102102
WithOptions(controller.Options{
103103
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
104104
RateLimiter: opts.RateLimiter,
105+
RecoverPanic: true,
105106
}).
106107
Complete(r)
107108
}

controllers/ocirepository_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ func (r *OCIRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, o
147147
WithOptions(controller.Options{
148148
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
149149
RateLimiter: opts.RateLimiter,
150+
RecoverPanic: true,
150151
}).
151152
Complete(r)
152153
}

0 commit comments

Comments
 (0)