[Controller] Refactor `gitlab_controller.go` into multiple files
gitlab_controller.go has grown much larger than what it should be. It is now over 1000 lines and while most related functions tend to be grouped together there are a few spots where utility functions are thrown in making them harder to find. gitlab_controller.go should be split up into multiple files to make the code in any one file more manageable.
My initial thoughts on how to split things up is to filter functions into something similar to the following files:
- jobs.go
- deployments.go
- external_component.go
- service_ingress.go
- utils.go
gitlab_controller.go would still exist to contain the high level functions like Reconcile() and SetupWithManager().
deployments.go will still probably be pretty big and it may be desirable to have further refinement or maybe another logical split of the functions that are deployment related.
external_component.go would be for functions like reconcileNGINX() and reconcileMinioInstance()
service_ingress.go would contain the Service and Ingress related functions. This file could be split into services.go and ingress.go with a single function in each file. Depends on how much wish to split things up.
utils.go would be all the supporting functions that are used by multiple functions or don't fit in well in other places. Functions like createOrPatch() and createOrUpdate() are good candidates for utils.go.