MCP-driven machineImage Capabilities management - #48
Conversation
There was a problem hiding this comment.
Pull request overview
This PR shifts OCI image capability handling to be driven by the CloudProfile’s spec.machineCapabilities: the controller passes capability annotation keys into the OCI source, the OCI source extracts/normalizes those annotations into Capabilities, and the image updater filters capability values based on the MachineCapabilities allowlist before writing capabilityFlavors.
Changes:
- Extend
OCISourceFactory/ OCI source construction to accept a list of capability annotation keys from the controller. - Update OCI source capability extraction to support arbitrary annotation keys and normalize underscore-prefixed feature values (e.g.
_usi→usi). - Add capability filtering in the OS image updater based on
CloudProfileSpec.MachineCapabilities, with updated/expanded tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| controllers/managedcloudprofile_controller.go | Extends OCISourceFactory interface to accept capability keys. |
| controllers/managedcloudprofile_controller_test.go | Updates test factories/mocks to match the new factory method signature. |
| controllers/cloud_profile.go | Derives capability annotation keys from spec.machineCapabilities and passes them into the OCI source factory. |
| cloudprofilesync/ossync/source/oci/os_source.go | Adds capability-key-driven annotation parsing and normalization; wires capability keys into OCI source. |
| cloudprofilesync/ossync/source/oci/os_source_test.go | Updates tests for new OCI capability parsing/normalization behavior. |
| cloudprofilesync/ossync/os_image_updater.go | Filters extracted capabilities against declared MachineCapabilities before writing capability flavors. |
| cloudprofilesync/ossync/os_image_updater_test.go | Adds tests validating capability filtering behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@coderabbitai review |
9b0444c to
8c913be
Compare
8c913be to
f9e2512
Compare
Merging this branch changes the coverage (1 decrease, 2 increase)
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
machineImage Capabilities management
No description provided.