Skip to content

Commit

Permalink
fix: Fails to reprocess Codebase in case error (#46)
Browse files Browse the repository at this point in the history
To fix the problem, the operator always
cleans the Codebase directory in case of errors.

Change-Id: I0e63c508bc637e11c7344881041c4f3c106d71b7
  • Loading branch information
zmotso committed Mar 12, 2024
1 parent 56cf361 commit caae8ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/codebase/codebase_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func (r *ReconcileCodebase) Reconcile(ctx context.Context, request reconcile.Req
log.Error(err, "Error during codebase reconciliation")
log.Info("Wait for next reconciliation", "timeout", timeout)

if cleanErr := removeDirectoryIfExists(ctx, codebase); cleanErr != nil {
log.Error(cleanErr, "Failed to remove Codebase directory")
}

return reconcile.Result{RequeueAfter: timeout}, nil
}

Expand Down

0 comments on commit caae8ad

Please sign in to comment.