oscerd commented on code in PR #26436:
URL: https://github.com/apache/camel/pull/26436#discussion_r4013549820


##########
components/camel-opa/src/main/java/org/apache/camel/component/opa/security/OpaSecurityPolicy.java:
##########
@@ -67,6 +70,7 @@ public OpaSecurityPolicy(String serverUrl, String policyPath) 
{
 
     @Override
     public void beforeWrap(Route route, NamedNode definition) {

Review Comment:
   Addendum, because my reply above understates it: the reorder was **not** 
free.
   
   `registerHealthCheck` skipped when `opaClient != null` — that was how it 
recognised an injected client. Run it at the end of `beforeWrap` and the policy 
has just built a client of its own, so the skip fires every time and **all 
five** health-check tests went red on the first run.
   
   The skip condition is now an explicit `ownsClient` flag set where the client 
is created, which states the actual rule: probe only a server we chose 
ourselves. Worth flagging since the suggested inline form 
(`registerHealthCheck(route)` after the `if` block) hits exactly the same thing.
   
   _Claude Code on behalf of @oscerd_



-- 
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]

Reply via email to