Description
From Ada Logics
Flux is composed of projects across different repositories and there is often similar logic happening across the controllers but performed in quite different ways. This leads to a more complex overall codebase and can make it difficult to reason about properties of the code.
Event recording and checking status of similar elements in the controllers is performed differently. This came up as an issue through fuzzing. Each of the controllers rely on an
EventRecoder, and the way theseEventRecordervariables are used differs between the controllers. Some controllers check for nil-status and others do not. TheHelmReleasereconciler and the Kustomization reconciler assume that theEventRecorderis notnilin their respectiveevent()implementations, whereas the other controls do not:
Helm Release Reconciler
Kustomize Reconciler
Image Update Automation Reconciler
Git Repository Reconciler
Recommendation
The same code pattern should be used across the controllers. Through our analysis we determined theEventRecordercannot benilusing the currentmain.gofiles and thus thenilcheck should be removed.