buildpacks-community/kpack

Refactor the source fetchers

chenbh opened this issue · 0 comments

Right now pkg/registry/fetch.go is in a bit of a weird place - it abstracts away the actual fetching of the image to an interface and doesn't interact with the other components of the same package.

I ran into this when I wanted to import a CNB-related constant into the registry fetcher, it fell into an import cycle of pkg/registry -> pkg/cnb -> pkg/dockercreds -> pkg/registry. Maybe I could've created a pkg/cnb/consts package for all the constants, but I feel that registry.Fetcher has fundamentally different uses than registry.Client, registry.KeychainFactory, and registry.Resolver.