cluster-api-provider-linode icon indicating copy to clipboard operation
cluster-api-provider-linode copied to clipboard

[cleanup] move non-reconcile functions into controller helpers

Open AshleyDumaine opened this issue 1 year ago • 1 comments

What this PR does / why we need it: General cleanup for controllers controller which should have helper functions in the appropriate helpers file for consistency

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #

Special notes for your reviewer:

TODOs:

  • [x] squashed commits
  • [ ] includes documentation
  • [ ] adds unit tests
  • [ ] adds or updates e2e tests

AshleyDumaine avatar Aug 19 '24 19:08 AshleyDumaine

Codecov Report

Attention: Patch coverage is 56.27907% with 94 lines in your changes missing coverage. Please review.

Project coverage is 64.51%. Comparing base (2c552d1) to head (2c47048). Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
controller/linodemachine_controller_helpers.go 62.39% 31 Missing and 13 partials :warning:
controller/linodecluster_controller_helpers.go 51.35% 35 Missing and 1 partial :warning:
controller/linodemachine_controller.go 25.00% 12 Missing :warning:
controller/linodecluster_controller.go 60.00% 1 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #470      +/-   ##
==========================================
+ Coverage   63.99%   64.51%   +0.51%     
==========================================
  Files          82       82              
  Lines        4322     4275      -47     
==========================================
- Hits         2766     2758       -8     
+ Misses       1323     1287      -36     
+ Partials      233      230       -3     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 19 '24 20:08 codecov[bot]

we should probably create a generic/common helpers file and put the non-reconciler specific functions in there

since we pass machineScope around so much, it looks like nothing actually needs the reconciler (r.Get can be replaced with machineScope.Client.Get). I was able to remove it on everything.

AshleyDumaine avatar Aug 21 '24 22:08 AshleyDumaine

LGTM

amold1 avatar Aug 21 '24 23:08 amold1