Summary
internal/controller/axonopsserver_controller.go is 3618 lines with nolint:gocyclo. The Reconcile method alone spans ~380 lines. This makes testing, reviewing, and maintaining the code prohibitively expensive.
Proposed split
| New file |
Functions to move |
timeseries.go |
reconcileTimeseries, ensureTimeseriesStatefulSet, buildTimeseriesEnv, cleanupInternalTimeseriesResources |
search.go |
reconcileSearch, ensureSearchStatefulSet, buildSearchEnv, cleanupInternalSearchResources |
server.go |
reconcileServer, ensureServerStatefulSet, ensureServerConfigSecret, buildServerConfig, buildServerEnv, server ingress/gateway functions |
dashboard.go |
reconcileDashboard, ensureDashboardDeployment, ensureDashboardConfigMap, dashboard ingress/gateway functions |
credentials.go |
ensureAuthenticationSecret, ensureKeystorePasswordSecret, generateRandomPassword, getSecretKeys, shouldRetainCredentials |
tls.go |
ensureTLSCertificate, ensureClusterIssuer |
helpers.go |
buildLabels, buildSelectorLabels, ptr, resolveInitImage, resolveImage, shared service/SA functions |
Acceptance Criteria
- No file > 800 lines
axonopsserver_controller.go contains only the Reconciler struct, Reconcile method, and SetupWithManager
- All functions remain in the same Go package (
controller)
- All existing tests pass without modification
make lint passes (no new issues)
Priority
P1
Summary
internal/controller/axonopsserver_controller.gois 3618 lines withnolint:gocyclo. The Reconcile method alone spans ~380 lines. This makes testing, reviewing, and maintaining the code prohibitively expensive.Proposed split
timeseries.goreconcileTimeseries,ensureTimeseriesStatefulSet,buildTimeseriesEnv,cleanupInternalTimeseriesResourcessearch.goreconcileSearch,ensureSearchStatefulSet,buildSearchEnv,cleanupInternalSearchResourcesserver.goreconcileServer,ensureServerStatefulSet,ensureServerConfigSecret,buildServerConfig,buildServerEnv, server ingress/gateway functionsdashboard.goreconcileDashboard,ensureDashboardDeployment,ensureDashboardConfigMap, dashboard ingress/gateway functionscredentials.goensureAuthenticationSecret,ensureKeystorePasswordSecret,generateRandomPassword,getSecretKeys,shouldRetainCredentialstls.goensureTLSCertificate,ensureClusterIssuerhelpers.gobuildLabels,buildSelectorLabels,ptr,resolveInitImage,resolveImage, shared service/SA functionsAcceptance Criteria
axonopsserver_controller.gocontains only the Reconciler struct, Reconcile method, and SetupWithManagercontroller)make lintpasses (no new issues)Priority
P1