Skip to content

Commit 3c06e94

Browse files
committed
Fix fetch error in push branch
Fixes error when push branch and reference branch are equal by skipping switch to push branch Signed-off-by: Pierre-Barthelemy Fiocconi <[email protected]>
1 parent 65e004f commit 3c06e94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/imageupdateautomation_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func (r *ImageUpdateAutomationReconciler) Reconcile(ctx context.Context, req ctr
308308
// When there's a push spec, the pushed-to branch is where commits
309309
// shall be made
310310

311-
if gitSpec.Push != nil {
311+
if gitSpec.Push != nil && !(ref != nil && ref.Branch == pushBranch) {
312312
// Use the git operations timeout for the repo.
313313
fetchCtx, cancel := context.WithTimeout(ctx, origin.Spec.Timeout.Duration)
314314
defer cancel()

0 commit comments

Comments
 (0)