-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
68 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,17 +35,17 @@ const ( | |
gitCommitAuthorEmail = "[email protected]" | ||
) | ||
|
||
type ClientFN func(url string, options ...gitea.ClientOption) (GiteaClient, error) | ||
type GiteaClientFunc func(url string, options ...gitea.ClientOption) (GiteaClient, error) | ||
|
||
func NewGiteaClient(url string, options ...gitea.ClientOption) (GiteaClient, error) { | ||
return gitea.NewClient(url, options...) | ||
} | ||
|
||
type RepositoryReconciler struct { | ||
client.Client | ||
GiteaClientFN ClientFN | ||
Recorder record.EventRecorder | ||
Scheme *runtime.Scheme | ||
GiteaClientFunc GiteaClientFunc | ||
Recorder record.EventRecorder | ||
Scheme *runtime.Scheme | ||
} | ||
|
||
func getRepositoryName(repo v1alpha1.GitRepository) string { | ||
|
@@ -108,7 +108,7 @@ func (r *RepositoryReconciler) postProcessReconcile(ctx context.Context, req ctr | |
func (r *RepositoryReconciler) reconcileGitRepo(ctx context.Context, repo *v1alpha1.GitRepository) (ctrl.Result, error) { | ||
logger := log.FromContext(ctx) | ||
logger.Info("reconciling", "name", repo.Name, "dir", repo.Spec.Source) | ||
giteaClient, err := r.GiteaClientFN(repo.Spec.GiteaURL) | ||
giteaClient, err := r.GiteaClientFunc(repo.Spec.GiteaURL) | ||
if err != nil { | ||
return ctrl.Result{Requeue: true, RequeueAfter: requeueTime}, fmt.Errorf("failed to get gitea client: %w", err) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters