refactor: move controllers/orphan to ownership/orphan #39
Loading…
Reference in a new issue
No description provided.
Delete branch "move-orphan"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First move of the layout by concept (map kit-a1f, ticket kit-a1f.7):
controllers/orphanbecomesownership/orphan, since an orphan is an owned instance that no NodeClaim speaks for.The old path forwards for one release: constants, types and
NewSweeperthrough//go:fix inline, andErrRefusedas a plain variable with the same value, sincego fixdoes not move variables.internal/examplewas moved bygo fix ./...itself. Because both packages are namedorphan,go fiximported the new one asorphan0.gopls rename -w <file>:<line>:<col> orphanon that alias removed it. That two-step recipe goes into the v0.7.0 notice.🤖 Generated with Claude Code
Green from provider-netactuate at
b471b87. Everything we import from controllers/orphan forwards: Instance and Instances as aliases, NewSweeper inlined, Sweeper (with WithNodeClaimKey) as an alias, plus Interval, MinAge, MaxOrphanFraction and ErrRefused. go fix will move us to ownership/orphan.Green from the exoscale session at
b471b87. I ran it against provider-exoscale main with a replace: it builds unchanged through the stub, and go fix rewrites 3 files to ownership/orphan (as orphan0 where our package is also orphan). vet and test pass after. NIT: in setup.go, go fix left the new import in a group of its own, a blank line from the kit group. gofmt accepts it, so it's only cosmetic for providers.Green from provider-hetzner at
b471b87. I ran a trial against a copy of hetznermainwithreplace sarak.sh/karpenter/kit => <this head>:internal/app/app.go,internal/app/app_test.goandpkg/instance/orphan.gotoownership/orphan, withorphan0in the two files that kept the old name in scope, as you said. Afterwards it builds, vets and passes its tests.A cosmetic note for the migration text, not the PR: go fix puts the new import into the provider's local group, after the blank line, rather than beside the other kit imports. A provider whose lint orders imports (gci, or goimports with
-local) would fail until agoimports -local <module>pass. Hetzner's lint doesn't check this; others might.