@@ -151,11 +151,7 @@ type GitRepositoryReconcilerOptions struct {
151151// v1.GitRepository (sub)reconcile functions.
152152type gitRepositoryReconcileFunc func (ctx context.Context , sp * patch.SerialPatcher , obj * sourcev1.GitRepository , commit * git.Commit , includes * artifactSet , dir string ) (sreconcile.Result , error )
153153
154- func (r * GitRepositoryReconciler ) SetupWithManager (mgr ctrl.Manager ) error {
155- return r .SetupWithManagerAndOptions (mgr , GitRepositoryReconcilerOptions {})
156- }
157-
158- func (r * GitRepositoryReconciler ) SetupWithManagerAndOptions (mgr ctrl.Manager , opts GitRepositoryReconcilerOptions ) error {
154+ func (r * GitRepositoryReconciler ) SetupWithManager (mgr ctrl.Manager , opts GitRepositoryReconcilerOptions ) error {
159155 r .patchOptions = getPatchOptions (gitRepositoryReadyCondition .Owned , r .ControllerName )
160156
161157 r .requeueDependency = opts .DependencyRequeueInterval
@@ -328,7 +324,7 @@ func (r *GitRepositoryReconciler) reconcile(ctx context.Context, sp *patch.Seria
328324func (r * GitRepositoryReconciler ) notify (ctx context.Context , oldObj , newObj * sourcev1.GitRepository , commit git.Commit , res sreconcile.Result , resErr error ) {
329325 // Notify successful reconciliation for new artifact, no-op reconciliation
330326 // and recovery from any failure.
331- if r .shouldNotify (oldObj , newObj , res , resErr ) {
327+ if r .shouldNotify (newObj , res , resErr ) {
332328 annotations := map [string ]string {
333329 fmt .Sprintf ("%s/%s" , sourcev1 .GroupVersion .Group , eventv1 .MetaRevisionKey ): newObj .Status .Artifact .Revision ,
334330 fmt .Sprintf ("%s/%s" , sourcev1 .GroupVersion .Group , eventv1 .MetaDigestKey ): newObj .Status .Artifact .Digest ,
@@ -362,7 +358,7 @@ func (r *GitRepositoryReconciler) notify(ctx context.Context, oldObj, newObj *so
362358// notification should be sent. It decides about the final informational
363359// notifications after the reconciliation. Failure notification and in-line
364360// notifications are not handled here.
365- func (r * GitRepositoryReconciler ) shouldNotify (oldObj , newObj * sourcev1.GitRepository , res sreconcile.Result , resErr error ) bool {
361+ func (r * GitRepositoryReconciler ) shouldNotify (newObj * sourcev1.GitRepository , res sreconcile.Result , resErr error ) bool {
366362 // Notify for successful reconciliation.
367363 if resErr == nil && res == sreconcile .ResultSuccess && newObj .Status .Artifact != nil {
368364 return true
@@ -595,7 +591,7 @@ func (r *GitRepositoryReconciler) reconcileSource(ctx context.Context, sp *patch
595591 conditions .Delete (obj , sourcev1 .FetchFailedCondition )
596592
597593 // Validate sparse checkout paths after successful checkout.
598- if err := r .validateSparseCheckoutPaths (ctx , obj , dir ); err != nil {
594+ if err := r .validateSparseCheckoutPaths (obj , dir ); err != nil {
599595 e := serror .NewGeneric (
600596 fmt .Errorf ("failed to sparse checkout directories : %w" , err ),
601597 sourcev1 .GitOperationFailedReason ,
@@ -1302,7 +1298,7 @@ func gitContentConfigChanged(obj *sourcev1.GitRepository, includes *artifactSet)
13021298}
13031299
13041300// validateSparseCheckoutPaths checks if the sparse checkout paths exist in the cloned repository.
1305- func (r * GitRepositoryReconciler ) validateSparseCheckoutPaths (ctx context. Context , obj * sourcev1.GitRepository , dir string ) error {
1301+ func (r * GitRepositoryReconciler ) validateSparseCheckoutPaths (obj * sourcev1.GitRepository , dir string ) error {
13061302 if obj .Spec .SparseCheckout != nil {
13071303 for _ , path := range obj .Spec .SparseCheckout {
13081304 fullPath := filepath .Join (dir , path )
0 commit comments