Pass request-scoped information in Context
Summary
If we pass down the request-scoped information in context we can pull out some of the functionalities of GitLabReconciler
(for example createOrPatch
, runJobAndWait
, etc.) and turn turn them into reusable generic utilities. We can gradually create reusable building blocks and this will lays the foundation for implementing and adopting workflow framework.
Symptom
GitLabReconciler
has a lot methods and its breakdown hasn't been neither easy nor efficient, e.g. #260 (closed) and !238 (merged). The only reason that they have GitLabReconciler
as the receiver is because they need to access to the some of the parameters, in particular the Client
interface.
When we factor out the utility functions we can repeating ourselves. For example we have at least two different implementations for waiting for a condition to satisfy (one for shared-secrets
Jobs and the other for upgrade Deployments).