squakez commented on code in PR #5245:
URL: https://github.com/apache/camel-k/pull/5245#discussion_r1523002685
##########
pkg/trait/error_handler.go:
##########
@@ -107,3 +120,17 @@ func (t *errorHandlerTrait)
addGlobalErrorHandlerAsSource(e *Environment) error
return nil
}
+
+// shouldHandleNoErrorHandler determines the runtime version and checks on
noErrorHandler that is configured for this version.
+func shouldHandleNoErrorHandler(it *v1.Integration) bool {
+ if it.Status.RuntimeVersion != "" {
+ runtimeVersion, _ :=
strings.CutSuffix(it.Status.RuntimeVersion, "-SNAPSHOT")
+ if versionNumber, err :=
strconv.Atoi(strings.ReplaceAll(runtimeVersion, ".", "")); err == nil {
Review Comment:
We use `semver` dependency somewhere in the code. You may reuse that logic
as well. In any case, I think this should be handled directly by the runtime,
so that the operator doesn't know the version and we do not need to do all this
hardcoding.
--
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]