UchihaIthachi commented on issue #6632: URL: https://github.com/apache/camel-k/issues/6632#issuecomment-6721966275
I had a look at this on main. For the controllers themselves it is already in place: Camel K uses controller-runtime v0.25.2, where `RecoverPanic` defaults to true when neither the controller nor the manager sets it (default since v0.19.0), and Camel K doesn't set it (no `Controller` config in the `manager.Options` in `pkg/cmd/operator/operator.go`). All six controllers are controller-runtime controllers, so a panic in `Reconcile` is already recovered and returned as an error. One place it doesn't cover: `monitor_routine.go` runs the build in its own goroutine (`go action.runBuild(ctx, build)`), and `RecoverPanic` only wraps `Reconcile`. Since `routine` is the default build strategy, a panic during a build would still take down the operator Pod. I'd suggest a deferred `recover()` in `runBuild` that marks the Build as Failed with the panic message (using the existing `status.Failed` / `updateBuildStatus` path), plus a unit test. Happy to send a PR if that sounds good. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
