@@ -724,11 +724,12 @@ func (r *GitRepositoryReconciler) gitCheckout(ctx context.Context,
724
724
checkoutStrategy , err := strategy .CheckoutStrategyForImplementation (ctx ,
725
725
git .Implementation (obj .Spec .GitImplementation ), checkoutOpts )
726
726
if err != nil {
727
+ // Do not return err as recovery without changes is impossible.
727
728
e := & serror.Stalling {
728
729
Err : fmt .Errorf ("failed to configure checkout strategy for Git implementation '%s': %w" , obj .Spec .GitImplementation , err ),
729
730
Reason : sourcev1 .GitOperationFailedReason ,
730
731
}
731
- // Do not return err as recovery without changes is impossible.
732
+ conditions . MarkTrue ( obj , sourcev1 . FetchFailedCondition , e . Reason , e . Err . Error ())
732
733
return nil , e
733
734
}
734
735
@@ -744,9 +745,10 @@ func (r *GitRepositoryReconciler) gitCheckout(ctx context.Context,
744
745
authOpts .TransportOptionsURL = fmt .Sprintf ("ssh://%s/%s/%d" , obj .Name , obj .UID , obj .Generation )
745
746
} else {
746
747
e := & serror.Stalling {
747
- Err : fmt .Errorf ("git repository URL has invalid transport type: '%s' " , obj .Spec .URL ),
748
+ Err : fmt .Errorf ("git repository URL '%s' has invalid transport type, supported types are: http, https, ssh " , obj .Spec .URL ),
748
749
Reason : sourcev1 .URLInvalidReason ,
749
750
}
751
+ conditions .MarkTrue (obj , sourcev1 .FetchFailedCondition , e .Reason , e .Err .Error ())
750
752
return nil , e
751
753
}
752
754
}
0 commit comments