Skip to content

Commit

Permalink
Implementing RecoverPanic on reconcilers to ensure it recovers from p…
Browse files Browse the repository at this point in the history
…anic instead of crashing the controller and Squashed commits.

Signed-off-by: Santosh Kaluskar <[email protected]>
  • Loading branch information
Santosh1176 committed Aug 11, 2022
1 parent 02ff549 commit 1ad2f00
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions controllers/bucket_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ func (r *BucketReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts Buc
WithOptions(controller.Options{
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
RateLimiter: opts.RateLimiter,
RecoverPanic: true,
}).
Complete(r)
}
Expand Down
1 change: 1 addition & 0 deletions controllers/gitrepository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func (r *GitRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, o
WithOptions(controller.Options{
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
RateLimiter: opts.RateLimiter,
RecoverPanic: true,
}).
Complete(r)
}
Expand Down
1 change: 1 addition & 0 deletions controllers/helmchart_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func (r *HelmChartReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, opts
WithOptions(controller.Options{
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
RateLimiter: opts.RateLimiter,
RecoverPanic: true,
}).
Complete(r)
}
Expand Down
1 change: 1 addition & 0 deletions controllers/helmrepository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func (r *HelmRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager,
WithOptions(controller.Options{
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
RateLimiter: opts.RateLimiter,
RecoverPanic: true,
}).
Complete(r)
}
Expand Down
1 change: 1 addition & 0 deletions controllers/helmrepository_controller_oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func (r *HelmRepositoryOCIReconciler) SetupWithManagerAndOptions(mgr ctrl.Manage
WithOptions(controller.Options{
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
RateLimiter: opts.RateLimiter,
RecoverPanic: true,
}).
Complete(r)
}
Expand Down
1 change: 1 addition & 0 deletions controllers/ocirepository_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func (r *OCIRepositoryReconciler) SetupWithManagerAndOptions(mgr ctrl.Manager, o
WithOptions(controller.Options{
MaxConcurrentReconciles: opts.MaxConcurrentReconciles,
RateLimiter: opts.RateLimiter,
RecoverPanic: true,
}).
Complete(r)
}
Expand Down

0 comments on commit 1ad2f00

Please sign in to comment.