In the Kubernetes ecosystem, I frequently run into a problem where I want to use some custom resource but its API package is in the same module as its controller (and loads of other crap) that have a massive dependency chain (often broken and "fixed" with replace directives). In several instances I've sent PRs to remove dependencies on
k8s.io/kubernetes from the modules, but this isn't scalable.
Do any tools exist that will extract a handful of low-dependency packages into a new module? It seems like something that must already exist and I'd rather not write it if I don't have to.