Fix the push branch reported in the logs and status if
`.spec.git.push.branch==.spec.git.checkout.branch`.
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
Add proxy support for Git operations using the proxy configuration
specified in the source GitRepository's `.spec.proxySecretRef`.
Refactor the Git client building process to make it more testable.
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
Add `.spec.git.push.refspec` to allow specifying a refspec to be used
for performing a push operation. If specified alongside
`.spec.git.push.branch`, two push operations, one for each specified
push configuration will be performed.
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
The metrics helper now accepts owned finalizers to determine if an
object is no longer managed by the controller and is being deleted, and
deletes the metrics associated with the object.
Call the metrics recording defer function in controller early to be able
to record the object in deleting state.
Signed-off-by: Sunny <darkowlzz@protonmail.com>
In Reconcile() method, move the object deletion above add finalizer.
Finalizers can't be set when an object is being deleted.
Introduce a cacheless client in suite_test to use for testing this
change. It ensures that the Reconcile() call always operates on the
latest version of the object which has the deletion timestamp and
existing finalizer.
Signed-off-by: Sunny <darkowlzz@protonmail.com>
Set package name in the files under internal/controller to have the
base name of the directory.
This style is recommended by Go, and certain text editors/IDEs get
confused when the names don't match.
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This replaces the `fluxcd/go-git` fork with official go-git v5.7.0
release, after all patches from the fork have been included
upstream.
Signed-off-by: Hidde Beydals <hidde@hhh.computer>