Repository navigation
feat: I expose CamelMonitor availability on Integrations - #6902
Conversation
I add an informational condition and kubectl column to show whether an Integration has an associated CamelMonitor. I verify direct ownership or the bounded Deployment/CronJob chain by namespace, name and UID. I reuse unstructured lookup and optional watches to keep the discovery condition current without changing runtime readiness. I add focused regression tests, minimal read permissions and regenerated CRD/Helm assets. Fixes apache#6898
squakez
left a comment
There was a problem hiding this comment.
Thanks for the PR. I think the logic can be simplified.
We should "watch" the CamelMonitor resources (when installed) and trigger a drift if a cmon is either created or removed. Then, in the monitoring state, the existing monitor action should just add or remove the condition accordingly.
I let CamelMonitor events use normal reconciliation and update the availability condition from the existing monitor action. I remove the separate status patch and fixed retry from the reconciler. I clear the condition when the association disappears and keep lookup errors from interrupting normal runtime monitoring. I move the kubectl column last and update the regression tests and documentation. Fixes apache#6898
|
I've pushed the requested update: the column is last, and the condition uses the existing monitor action. The focused tests pass; the known baseline failure is documented in the description. Could you approve the pending workflows and take another look once CI has run? I write it, AI helps with my English (@manduinca). |
Sorry, it does not seem to go in the right direction. I have the feeling this work require a bit more knowledge on the foundation for the project. I'm removing the "good first issue" as it does not seem to be that easy as we originally thought. |
I integrate current main and preserve optional watches, direct monitor reads and stored ownership checks in the existing monitoring action.
squakez
left a comment
There was a problem hiding this comment.
I think we need a different approach. We should add a watch condition in the controller for the "CamelMonitor" resource, it the CRD is installed (like we do for KnativeService). Then the watch should have a similar logic of what we do in "enqueueRequestsFromConfigFunc" function, being able to wake up only that integration that should be a monitoring.
In the monitor action handler ((action *monitorAction) Handle) we can look for existing cmon that may belong to this Integration (same camel.apache.org/monitor label, which is configured in CAMEL_MONITOR_OPERATOR_LABEL env var). If a resource exist, then, we set the condition, otherwise, we remove the condition.
squakez
left a comment
There was a problem hiding this comment.
It's getting better and I think it is quite complete. Still some points to polish. Once complete we should also provide an e2e workflow to test a real scenario. But that can be done in a follow up commit.
squakez
left a comment
There was a problem hiding this comment.
Still some work to do, after that I think we're good to go.
squakez
left a comment
There was a problem hiding this comment.
Nice, the core of the PR is good. Few minor adjustment if you can and if it passes checks is ready for merge.
|
✔️ Unit test coverage report - coverage increased from 64.8% to 64.9% (+0.1%) |
|
✔️ Unit test coverage report - coverage increased from 64.9% to 65% (+0.1%) |
|
✔️ Unit test coverage report - coverage increased from 64.9% to 65% (+0.1%) |
* Fix #6898: I report associated CamelMonitor resources I add an informational condition and kubectl column to show whether an Integration has an associated CamelMonitor. I verify direct ownership or the bounded Deployment/CronJob chain by namespace, name and UID. I reuse unstructured lookup and optional watches to keep the discovery condition current without changing runtime readiness. I add focused regression tests, minimal read permissions and regenerated CRD/Helm assets. Fixes #6898 * Fix #6898: I update discovery through the monitor action I let CamelMonitor events use normal reconciliation and update the availability condition from the existing monitor action. I remove the separate status patch and fixed retry from the reconciler. I clear the condition when the association disappears and keep lookup errors from interrupting normal runtime monitoring. I move the kubectl column last and update the regression tests and documentation. Fixes #6898 * Fix #6898: I simplify monitor discovery with watches and labels * Fix #6898: I check monitor availability during reconciliation * Fix #6898: I cover CamelMonitor discovery with an e2e workflow * Fix #6898: I reconcile monitors after source changes * Fix #6898: I simplify CamelMonitor discovery
I add the
CamelMonitorAvailablecondition and a finalCamel Monitorkubectl column to show whether an Integration has a same-named CamelMonitor in its namespace, independently of runtime readiness.I check API availability in
Add, handle discovery errors there, and pass the flag to the monitor action. I keep the direct controller setup and use the existingStatusChangedPredicatefor the optional watch. The monitor adds or removes the condition with a GET; RBAC is limited toget/list/watchon CamelMonitor resources.I update CMO to 1.0.0 and install it before Camel K through the official overlay. I simplify the test target as requested.
I merge main at
b7527674, including the project's namespace lookup/RBAC fix (2653b794). I resolve thego.sumconflict with main's dependency versions and regenerate it withgo mod tidy.Validation for this main sync:
camel-monitorworkflow passed on the previous head,8e9a80b. I have not rerun cluster e2e locally after this main sync; the new head still needs GitHub CI.Fixes #6898
I directed the AI-generated code and description in this PR (@manduinca).