-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Summary
The resolution framework has two parallel package trees that serve the same purpose:
pkg/resolution/resolver/— the original framework (2022), now marked deprecated on all exported typespkg/remoteresolution/resolver/— the upgraded framework (2024), intended replacement
The new package was introduced to change the Resolver interface from accepting []pipelinev1.Param to *v1beta1.ResolutionRequestSpec, giving resolvers access to the full request spec (including URL-based resolution). However, the migration was never completed — the new package heavily imports from and delegates business logic to the old one.
This creates confusion for contributors and out-of-tree resolver authors about which package to use, and adds maintenance burden of keeping two parallel codebases in sync.
Current State
The remoteresolution package depends on the old resolution package for:
- Shared types/interfaces:
ResolvedResource,ConfigWatcher,TimedResolution,ConfigStore— all defined in the oldframeworkpackage - Business logic: Each new resolver delegates core work to the old one:
remoteresolution/bundle→ callsresolution/bundle.ResolveRequest(),ValidateParams()remoteresolution/cluster→ callsresolution/cluster.ResolveFromParams(),ValidateParams()remoteresolution/git→ importsresolution/gitfor config, SCM logicremoteresolution/http→ importsresolution/httpfor config, fetch logicremoteresolution/hub→ importsresolution/hubfor config, API client logic
- Constants: All config map names, param names, and annotation keys live in the old package
Scope
- Old package: ~4,100 lines production code + ~4,800 lines tests across 37 Go files
- The
demoresolvertemplate still uses the old interface - The new resolver template imports from both packages
Proposed Approach
This can be done incrementally across multiple PRs:
- Move shared types and utilities (
ResolvedResource,ConfigWatcher,TimedResolution,ConfigStore, etc.) intopkg/remoteresolution/resolver/framework/ - Inline resolver business logic — one PR per resolver (bundle, cluster, git, http, hub) to move the actual implementation from
pkg/resolution/resolver/<type>/intopkg/remoteresolution/resolver/<type>/, eliminating the delegation pattern - Update consumers —
cmd/resolvers/main.go, doc templates, test resolvers - Delete
pkg/resolution/resolver/and update documentation
Breaking Change for Out-of-Tree Resolvers
This is a breaking change for any external resolver importing pkg/resolution/resolver/. Known consumers:
- Custom/community resolvers using the old
Resolverinterface (ValidateParams/Resolvewith[]Param) - The old
ResolvedResourceinterface import path changes
We should announce this deprecation removal in advance and provide a migration guide (the new resolver template in docs/resolver-template/cmd/resolver/ already demonstrates the new interface).
Acceptance Criteria
-
pkg/resolution/resolver/is fully removed -
pkg/remoteresolution/resolver/is self-contained (no imports from old package) - All built-in resolvers work correctly
- Resolver templates use only the new package
- Documentation updated with new import paths
- Release notes document the breaking change
/kind cleanup