refactor: move controllers/orphan to ownership/orphan #39

Merged
mikluko merged 2 commits from move-orphan into main 2026-12-01 06:34:52 +00:00
Owner

First move of the layout by concept (map kit-a1f, ticket kit-a1f.7): controllers/orphan becomes ownership/orphan, since an orphan is an owned instance that no NodeClaim speaks for.

The old path forwards for one release: constants, types and NewSweeper through //go:fix inline, and ErrRefused as a plain variable with the same value, since go fix does not move variables. internal/example was moved by go fix ./... itself. Because both packages are named orphan, go fix imported the new one as orphan0. gopls rename -w <file>:<line>:<col> orphan on that alias removed it. That two-step recipe goes into the v0.7.0 notice.

🤖 Generated with Claude Code

First move of the layout by concept (map kit-a1f, ticket kit-a1f.7): `controllers/orphan` becomes `ownership/orphan`, since an orphan is an owned instance that no NodeClaim speaks for. The old path forwards for one release: constants, types and `NewSweeper` through `//go:fix inline`, and `ErrRefused` as a plain variable with the same value, since `go fix` does not move variables. `internal/example` was moved by `go fix ./...` itself. Because both packages are named `orphan`, `go fix` imported the new one as `orphan0`. `gopls rename -w <file>:<line>:<col> orphan` on that alias removed it. That two-step recipe goes into the v0.7.0 notice. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
refactor: move controllers/orphan to ownership/orphan
Some checks failed
CI / verify (pull_request) Has been skipped
CI / changelog (pull_request) Successful in 1s
Vulnerabilities / govulncheck-1 (pull_request) Successful in 10s
Vulnerabilities / govulncheck (pull_request) Successful in 0s
CI / check (pull_request) Failing after 52s
CI / ci (pull_request) Failing after 0s
e30c1e2fb7
An orphan is an owned instance no NodeClaim speaks for, so it nests under
ownership (kit-a1f). The old path forwards through go:fix inline for one
release; internal/example was moved by go fix itself, then gopls rename
dropped the orphan0 alias go fix adds when both packages share a name.

Closes kit-a1f.7.

Assisted-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test(orphan): forwarder tests go fix leaves alone
Some checks failed
CI / changelog (pull_request) Successful in 1s
CI / verify (pull_request) Has been skipped
Vulnerabilities / govulncheck-1 (pull_request) Successful in 20s
Vulnerabilities / govulncheck (pull_request) Successful in 0s
CI / check (pull_request) Successful in 1m59s
CI / ci (pull_request) Successful in 0s
CI / verify (push) Has been skipped
CI / changelog (push) Has been skipped
Vulnerabilities / govulncheck (push) Has been cancelled
Vulnerabilities / govulncheck-1 (push) Has been cancelled
CI / check (push) Successful in 1s
CI / ci (push) Successful in 0s
b471b879f7
Assisted-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

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 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.
Author
Owner

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 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.
Author
Owner

Green from provider-hetzner at b471b87. I ran a trial against a copy of hetzner main with replace sarak.sh/karpenter/kit => <this head>:

  • Before go fix: builds, vets and passes its tests through the forwarders unchanged.
  • go fix: rewrites internal/app/app.go, internal/app/app_test.go and pkg/instance/orphan.go to ownership/orphan, with orphan0 in 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 a goimports -local <module> pass. Hetzner's lint doesn't check this; others might.

Green from provider-hetzner at b471b87. I ran a trial against a copy of hetzner `main` with `replace sarak.sh/karpenter/kit => <this head>`: - **Before go fix:** builds, vets and passes its tests through the forwarders unchanged. - **go fix:** rewrites `internal/app/app.go`, `internal/app/app_test.go` and `pkg/instance/orphan.go` to `ownership/orphan`, with `orphan0` in 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 a `goimports -local <module>` pass. Hetzner's lint doesn't check this; others might.
mikluko deleted branch move-orphan 2026-12-01 06:34:52 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
karpenter/kit!39
No description provided.