Skip to content

Commit b94bde3

Browse files
bdehamerCopilot
andcommitted
refactor: split controller.go into focused files by concern
Split the 995-line controller.go into four files organized by responsibility: - controller.go (~195 lines): types, interfaces, Controller struct, New(), Run() - handlers.go (~205 lines): event handler registration, worker loop - reconcile.go (~450 lines): event processing, deployment recording, workload resolution, cache existence checks - pod.go (~195 lines): pod utility functions, informer factory Extract registerEventHandlers() from New() as a Controller method and newAPIClient() as a package-level helper to simplify the constructor. Fix a pre-existing bug in DeleteFunc where MetaNamespaceKeyFunc(obj) was called on the original obj which may be a DeletedFinalStateUnknown tombstone (causing silent event drops). Now uses the extracted pod instead. No other behavioral changes — pure structural refactoring. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1b2e649 commit b94bde3

File tree

4 files changed

+884
-837
lines changed

4 files changed

+884
-837
lines changed

0 commit comments

Comments
 (0)