Skip to content

fix!: move verification to resolution service#1707

Merged
jakobmoellerdev merged 110 commits into
open-component-model:mainfrom
frewilhelm:move-verification
Mar 12, 2026
Merged

fix!: move verification to resolution service#1707
jakobmoellerdev merged 110 commits into
open-component-model:mainfrom
frewilhelm:move-verification

Conversation

@frewilhelm

@frewilhelm frewilhelm commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it

This PR refactors signature verification logic by moving it from the component controller to the resolution service (worker pool). This centralizes verification and improves separation of concerns.

Key Changes
  • Worker Pool: Implements complete signature verification logic with new ErrNotSafelyDigestible error type to distinguish safely digestible components from verification failures.
  • Controllers: Remove verification methods and delegate to resolution service; updated error handling to gracefully handle non-digestible components.
  • Cache Repository: Passes verification configurations, the digest specification of a component reference from the parent component, and signing registry to worker pool for centralized handling and trusted cache keys.
  • Component reference integrity: If the component reference provides a digest specification, we re-generate the digest of the child component descriptor to ensure integrity.
Benefits
  • Centralized verification logic reduces duplication across Component, Resource, and Deployer controllers
  • Improved error handling with consistent behavior across all controllers
  • Better separation of concerns: controllers orchestrate, resolution service verifies

Which issue(s) this PR fixes

Fixes open-component-model/ocm-project#787

Summary by CodeRabbit

  • New Features

    • Digest- and signature-aware component resolution and verification.
    • Helm nested-signed example with sample repository, component, resource, deployer and signing keys.
    • Resource reconciliation Interval field for finer cadence control.
  • Improvements

    • Non-fatal event signaling for digest/integrity issues.
    • Metrics now include verification state for better observability.
    • CRD description clarified for the signature field.
    • New condition reporting for component drift resolution.
  • Tests

    • Expanded signing, verification, nested-resolution and cache/metrics test coverage.

Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
@frewilhelm frewilhelm marked this pull request as ready for review February 3, 2026 14:34
@frewilhelm frewilhelm requested a review from a team as a code owner February 3, 2026 14:34
@frewilhelm frewilhelm marked this pull request as draft February 3, 2026 14:38
Comment thread kubernetes/controller/internal/controller/component/component_controller.go Outdated
Comment thread kubernetes/controller/internal/resolution/workerpool/workerpool.go Outdated
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
Comment thread kubernetes/controller/api/v1alpha1/condition_types.go
Comment thread kubernetes/controller/internal/controller/component/component_controller.go Outdated
Comment thread kubernetes/controller/internal/controller/deployer/deployer_controller.go Outdated
Comment thread kubernetes/controller/internal/controller/resource/resource_controller.go Outdated
Comment thread kubernetes/controller/internal/ocm/resource.go
Comment thread kubernetes/controller/internal/resolution/workerpool/workerpool.go
Comment thread kubernetes/controller/internal/resolution/cached_repository.go
Comment thread kubernetes/controller/internal/resolution/cached_repository.go Outdated
Comment thread kubernetes/controller/internal/resolution/cached_repository.go
Comment thread kubernetes/controller/internal/resolution/doc.go Outdated
Comment thread kubernetes/controller/internal/ocm/resource.go
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
@Skarlso

Skarlso commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

I'm doing some nicification here and there and a general facelift going over the entire change.

I'll try to make it brief though. Hopefully, I can actually reduce the complexity here somewhat. I see that we actually don't need some of these things that we did here. So I'm going to give this a general facelift.

I will avoid changing too much though because I don't want people to have to re-read the entire thing. So I'll do one commit that you can view that will contain all the changes.

…eters

On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com>

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
@Skarlso

Skarlso commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Here are the refactored changes that hopefully make the code a bit better and more readable.
83bf3da

I found a couple of things:

  • newCacheBackedRepository removed -> this was literally not needed
  • ResolveReferencePath params -> we already had RepositoryOptions that contained everything
  • findMatchingReference and extractDigest -> extracted from the ResolveReferencePath loop
  • identityFunc -> this was a straight duplicate of ocm.IdentityFuncIgnoreVersion()
  • some duplication on constructing RepositoryOptions in the deployer's getEffectiveComponentDescriptor
  • fixed bug -> errReferencePath was actually wrapping the wrong error :D

On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com>

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
@frewilhelm frewilhelm requested a review from fabianburth March 12, 2026 12:06
@jakobmoellerdev jakobmoellerdev enabled auto-merge (squash) March 12, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!BREAKING-CHANGE! Breaking change in API or ocm-cli or spec kind/bugfix Bug size/l Large size/m Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move component verification to resolution service

6 participants