ansh0014 opened a new pull request, #6994:
URL: https://github.com/apache/camel-k/pull/6994

   Fixes #6981
   
   ### Discription
   When an optional watched CRD (such as `CamelMonitor` or Knative `Service`) 
is deleted at runtime while the operator is running, `client-go`'s `Reflector` 
hits `NotFound` / `meta.NoKindMatchError` and logs `"level":"error"` on every 
backoff retry via `DefaultWatchErrorHandler`. In addition, 
`addCamelMonitorCondition` could fail Integration reconciliation with 
`NoKindMatchError` if `CamelMonitor` was available at startup and later removed.
   
   Changes:
   - Configured `cache.Options.DefaultWatchErrorHandler` in 
`pkg/cmd/operator/operator.go` to catch `NotFound` and `NoKindMatchError` watch 
errors, logging once at `Info` (and `Debug` afterwards) instead of delegating 
to `utilruntime.HandleErrorWithContext`, while keeping backoff so watches 
recover automatically if the CRD is reinstalled.
   - Updated `addCamelMonitorCondition` in 
`pkg/controller/integration/camel_monitor.go` to treat 
`meta.IsNoMatchError(err)` like `NotFound` and clear the 
`CamelMonitorAvailable` condition.
   - Added unit tests (`TestWatchErrorHandler` and 
`TestCamelMonitorNoMatchError`).


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