Skip to content

feat: I expose CamelMonitor availability on Integrations - #6902

Merged
squakez merged 12 commits into
apache:mainfrom
manduinca:feature/6898-camel-monitor-condition
Nov 11, 2026
Merged

squakez merged 12 commits into
apache:mainfrom
manduinca:feature/6898-camel-monitor-condition

Conversation

@manduinca

@manduinca manduinca commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

I add the CamelMonitorAvailable condition and a final Camel Monitor kubectl 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 existing StatusChangedPredicate for the optional watch. The monitor adds or removes the condition with a GET; RBAC is limited to get/list/watch on 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 the go.sum conflict with main's dependency versions and regenerate it with go mod tidy.

Validation for this main sync:

  • Generation, documentation, formatting and official lint pass (95 linters, 0 issues).
  • All 105 targeted integration-controller, platform and Kubernetes-helper tests pass.
  • Linux/macOS builds and compilation of all e2e suites pass.
  • The local Kind/CMO e2e and the GitHub camel-monitor workflow 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).

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 squakez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pkg/apis/camel/v1/integration_types.go Resolved
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
@manduinca

Copy link
Copy Markdown
Contributor Author

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

@squakez

squakez commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

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?

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 squakez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pkg/cmd/operator/operator.go Resolved
Comment thread pkg/cmd/operator/operator.go Resolved
Comment thread pkg/cmd/operator/operator_test.go Resolved

@squakez squakez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 squakez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still some work to do, after that I think we're good to go.

Comment thread .github/workflows/camel-monitor.yml Resolved
Comment thread .github/workflows/camel-monitor.yml Resolved
Comment thread e2e/camelmonitor/camel_monitor_test.go Resolved
Comment thread e2e/camelmonitor/camel_monitor_test.go Resolved
Comment thread pkg/controller/integration/monitor.go Resolved
Comment thread go.mod Resolved
Comment thread pkg/controller/integration/monitor.go Resolved

@squakez squakez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, the core of the PR is good. Few minor adjustment if you can and if it passes checks is ready for merge.

Comment thread .github/workflows/camel-monitor.yml Resolved
Comment thread pkg/controller/integration/monitor.go Resolved
Comment thread script/Makefile Resolved
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

✔️ Unit test coverage report - coverage increased from 64.8% to 64.9% (+0.1%)

@github-actions

Copy link
Copy Markdown
Contributor

✔️ Unit test coverage report - coverage increased from 64.9% to 65% (+0.1%)

@github-actions

Copy link
Copy Markdown
Contributor

✔️ Unit test coverage report - coverage increased from 64.9% to 65% (+0.1%)

@squakez
squakez merged commit 779163e into apache:main Nov 11, 2026
17 of 18 checks passed
squakez pushed a commit that referenced this pull request Nov 15, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a condition and a kubebuilder flag for CamelMonitor resources

2 participants