Skip to content

v2 rework - #46

Open
Diaphteiros wants to merge 30 commits into
mainfrom
v2
Open

v2 rework#46
Diaphteiros wants to merge 30 commits into
mainfrom
v2

Conversation

@Diaphteiros

Copy link
Copy Markdown

What this PR does / why we need it:
So far, the usage-operator was hardcoded to watch only our v1 MCP resource. In order to make it compatible with v2, it needed to be extended so it can also watch ControlPlane resources.

Instead of just adding watches for the v2 resources, the usage-operator is now generic and can watch arbitrary resources on the onboarding cluster. This is configured in a configuration CR, which is now required. In addition to tracking a resource's existence, the controller can also watch arbitrary fields within either the resource's or its namespace's manifest.

The old MCPUsage resource has been replaced by a new ResourceUsage resource, which stores timestamps of modification instead of durations directly. New helper methods in the api package can be used to convert them into durations.

Which issue(s) this PR fixes:
This is a relevant part of https://github.tools.sap/openmcp/internal-backlog/issues/516

Special notes for your reviewer:

Since this turned out to be more of a re-implementation instead of a refactoring, and a quite complex one due to the dynamic watches on top of that, I strongly suggest to read through the updated documentation first, before attempting to review this PR.

Release note:

The usage-operator has been refactored and can now watch arbitrary resources, as well as specific fields within their and their namespace's manifests. It now requires a configuration CR and creates `ResourceUsage` resources instead of `MCPUsage` ones. This is a major change, have a look at the updated documentation for further information.

Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
@Diaphteiros
Diaphteiros requested a review from n3rdc4ptn July 21, 2026 07:43
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
Signed-off-by: Johannes Aubart <johannes.aubart@sap.com>
@Diaphteiros
Diaphteiros marked this pull request as ready for review August 3, 2026 15:05
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.

1 participant