Fix GitRepository controller stalling when it shouldn't

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
This commit is contained in:
Matheus Pimenta 2025-08-12 14:34:12 +01:00
parent a84403c95b
commit 1f4fc2fe87
No known key found for this signature in database
GPG Key ID: 929AEFAE644BF334
1 changed files with 2 additions and 2 deletions

View File

@ -591,7 +591,7 @@ func (r *GitRepositoryReconciler) reconcileSource(ctx context.Context, sp *patch
// Validate sparse checkout paths after successful checkout.
if err := r.validateSparseCheckoutPaths(ctx, obj, dir); err != nil {
e := serror.NewStalling(
e := serror.NewGeneric(
fmt.Errorf("failed to sparse checkout directories : %w", err),
sourcev1.GitOperationFailedReason,
)
@ -747,7 +747,7 @@ func (r *GitRepositoryReconciler) getAuthOpts(ctx context.Context, obj *sourcev1
default:
// analyze secret, if it has github app data, perhaps provider should have been github.
if appID := authData[github.KeyAppID]; len(appID) != 0 {
e := serror.NewStalling(
e := serror.NewGeneric(
fmt.Errorf("secretRef '%s/%s' has github app data but provider is not set to github", obj.GetNamespace(), obj.Spec.SecretRef.Name),
sourcev1.InvalidProviderConfigurationReason,
)