Skip to content

feat: add component reference resolvers to the controller#1635

Merged
fabianburth merged 35 commits into
open-component-model:mainfrom
Skarlso:implement-resolvers-in-the-controller
Feb 3, 2026
Merged

feat: add component reference resolvers to the controller#1635
fabianburth merged 35 commits into
open-component-model:mainfrom
Skarlso:implement-resolvers-in-the-controller

Conversation

@Skarlso

@Skarlso Skarlso commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it

Involved in open-component-model/ocm-project#777

Which issue(s) this PR fixes

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
…ider based approach akin to the CLI

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com>

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/m Medium labels Jan 21, 2026
Comment thread kubernetes/controller/internal/resolution/cached_repository.go Outdated
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com>

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Comment thread kubernetes/controller/internal/setup/resolver.go Outdated
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
@github-actions github-actions Bot added the size/l Large label Jan 21, 2026
Skarlso and others added 2 commits January 21, 2026 16:08
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com>

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
@Skarlso Skarlso marked this pull request as ready for review January 22, 2026 08:13
@Skarlso Skarlso requested a review from a team as a code owner January 22, 2026 08:13
Comment thread kubernetes/controller/internal/resolution/cached_repository.go Outdated
Comment thread kubernetes/controller/internal/resolution/service.go Outdated
@Skarlso

Skarlso commented Jan 22, 2026

Copy link
Copy Markdown
Contributor Author

I refactored a bunch of things, aaand

  status:
    component:
      component: github.com/gardener/etcd-druid
      repositorySpec:
        baseUrl: ghcr.io
        subPath: platform-mesh
        type: OCIRegistry
      version: v0.34.0
    conditions:
    - lastTransitionTime: "2026-01-22T17:13:15Z"
      message: Applied version v0.34.0
      observedGeneration: 1
      reason: Succeeded
      status: "True"
      type: Ready

Still works 🎉

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

Skarlso commented Jan 22, 2026

Copy link
Copy Markdown
Contributor Author

@fabianburth Okay, this has now three package changes.

  1. The newly created resolver package under bindings/go/repositroy/component ( location can be changed, it made sense )
  2. Credential extraction because that's common in other ways
  3. Refactored CLI pacakge
  4. Written Kubernetes controller package changes for the resolver that I tested above.

I will put each of these into separate PRs but left this together for reviewing.

Comment thread cli/internal/credentials/config.go Outdated
Comment thread kubernetes/controller/internal/setup/resolver_provider.go Outdated

@fabianburth fabianburth 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 like this much better than before. Maybe some unit tests for the provider package might be nice.

Comment thread bindings/go/repository/component/provider/factory.go Outdated
Comment thread bindings/go/repository/component/provider/factory.go Outdated
Comment thread cli/internal/credentials/config.go Outdated
Comment thread cli/internal/repository/ocm/compatibility_test.go
Comment thread kubernetes/controller/internal/resolution/cached_repository.go Outdated
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com>

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

Skarlso commented Jan 23, 2026

Copy link
Copy Markdown
Contributor Author

I'm going to start and create the individual PRs for this. :) First, the extraction. :)

Comment thread kubernetes/controller/internal/setup/resolver.go Outdated

@matthiasbruns matthiasbruns 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.

Man this brought back some memories 🥲

I think it's good, the only thing we should decide on is how to continue with the health checks. @Skarlso do you want to make a call and decide what to do?

@Skarlso

Skarlso commented Jan 23, 2026

Copy link
Copy Markdown
Contributor Author

@matthiasbruns I think the war room is enough. I'll bring it up next time I'm around. :)

@Skarlso

Skarlso commented Jan 23, 2026

Copy link
Copy Markdown
Contributor Author

Two other PRs have been created, once merged, going to separate this PR into CLI and then Controller. :)

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>

# Conflicts:
#	cli/go.mod
#	cli/go.sum
#	cli/integration/go.mod
#	cli/integration/go.sum
#	kubernetes/controller/go.mod
#	kubernetes/controller/go.sum

@Skarlso Skarlso left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have a few questions about the new approach. :)

Comment thread bindings/go/repository/component/providers/pathmatcher.go Outdated
Comment thread kubernetes/controller/internal/resolution/cached_repository.go
Comment thread kubernetes/controller/internal/resolution/cached_repository.go Outdated
Comment thread bindings/go/repository/component/providers/pathmatcher.go Outdated
Comment thread bindings/go/repository/component/providers/pathmatcher.go
Comment thread kubernetes/controller/internal/resolution/cached_repository.go
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
# Conflicts:
#	bindings/go/repository/component/fallback/v1/repository.go
#	bindings/go/repository/component/fallback/v1/repository_test.go
#	bindings/go/repository/component/providers/fallback.go
#	bindings/go/repository/component/providers/interface.go
#	bindings/go/repository/component/providers/pathmatcher.go
#	bindings/go/repository/component/resolvers/factory.go
#	bindings/go/repository/component/resolvers/pathmatcher_test.go
#	cli/integration/go.sum
@Skarlso

Skarlso commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

FWIW the LRU cache has a pending PR for closing the cache cleanup hashicorp/golang-lru#214. It is LGTM but no idea when it will be merged / released. The Cache itself hasn't been release since Sep 29, 2023.

@Skarlso

Skarlso commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

After this is done, we need to remove the HashiCorp LRU from the worker as well.

Signed-off-by: Fabian Burth <fabian.burth@sap.com>
@fabianburth fabianburth force-pushed the implement-resolvers-in-the-controller branch from 4b0d7ff to bf6553b Compare February 2, 2026 14:09
fabianburth and others added 8 commits February 2, 2026 15:11
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
Signed-off-by: Fabian Burth <fabian.burth@sap.com>
jakobmoellerdev
jakobmoellerdev previously approved these changes Feb 2, 2026
Comment thread kubernetes/controller/internal/setup/integration_test.go Outdated
Signed-off-by: Gergely Bräutigam <gergely.brautigam@sap.com>
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

@matthiasbruns matthiasbruns 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.

lgtm

@fabianburth fabianburth enabled auto-merge (squash) February 3, 2026 08:03
@fabianburth fabianburth merged commit 2a57af1 into open-component-model:main Feb 3, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature new feature, enhancement, improvement, extension size/l Large size/m Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants