Summary
AxonOpsServerReconciler.Reconcile is 376 lines with deep nesting, multiple conditional branches, and a // nolint:gocyclo suppression. It handles finalizers, cert-manager verification, TimeSeries/Search/Server/Dashboard reconciliation (each with 3+ branches), and status updates all in one method.
Detailed Requirements
The Reconcile method should be an orchestrator of approximately 20 lines that delegates to component-specific methods. Each component (TimeSeries, Search, Server, Dashboard) should have its own reconciliation entry point method. Finalizer handling, cert-manager checks, and status updates should be extracted into their own methods.
The nolint:gocyclo suppression must be removed after refactoring.
Location
internal/controller/axonopsserver_controller.go:236-612
Acceptance Criteria
Reconcile method is under 50 lines, delegating to component-specific methods
- Each component (TimeSeries, Search, Server, Dashboard) has its own reconciliation entry point
nolint:gocyclo suppression is removed
- All existing tests continue to pass without modification
- No behavioral changes — pure refactoring
Testing Requirements
- All existing unit tests must pass unchanged
- Run
golangci-lint with gocyclo enabled (no nolint) and verify no violations
- Each extracted method should be independently testable
Documentation Requirements
- Add godoc comments to each extracted method explaining its responsibility
Dependencies
- None (but this refactoring makes other fixes easier to implement)
Priority
BLOCKING — maintainability risk; high cyclomatic complexity makes other bug fixes risky
Summary
AxonOpsServerReconciler.Reconcileis 376 lines with deep nesting, multiple conditional branches, and a// nolint:gocyclosuppression. It handles finalizers, cert-manager verification, TimeSeries/Search/Server/Dashboard reconciliation (each with 3+ branches), and status updates all in one method.Detailed Requirements
The
Reconcilemethod should be an orchestrator of approximately 20 lines that delegates to component-specific methods. Each component (TimeSeries, Search, Server, Dashboard) should have its own reconciliation entry point method. Finalizer handling, cert-manager checks, and status updates should be extracted into their own methods.The
nolint:gocyclosuppression must be removed after refactoring.Location
internal/controller/axonopsserver_controller.go:236-612Acceptance Criteria
Reconcilemethod is under 50 lines, delegating to component-specific methodsnolint:gocyclosuppression is removedTesting Requirements
golangci-lintwith gocyclo enabled (no nolint) and verify no violationsDocumentation Requirements
Dependencies
Priority
BLOCKING — maintainability risk; high cyclomatic complexity makes other bug fixes risky