From 1096b38075c9dc1ee3adb313778938c3267431cb Mon Sep 17 00:00:00 2001 From: Manabu McCloskey Date: Thu, 2 May 2024 19:03:12 +0000 Subject: [PATCH] revert requeue time Signed-off-by: Manabu McCloskey --- pkg/controllers/gitrepository/git_repository.go | 2 +- pkg/controllers/gitrepository/github.go | 4 ++-- pkg/controllers/localbuild/controller.go | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/controllers/gitrepository/git_repository.go b/pkg/controllers/gitrepository/git_repository.go index cc4bbf08..e218e1ee 100644 --- a/pkg/controllers/gitrepository/git_repository.go +++ b/pkg/controllers/gitrepository/git_repository.go @@ -20,7 +20,7 @@ type GiteaClient interface { SetContext(ctx context.Context) } -type gitHubClientI interface { +type gitHubClient interface { getRepo(ctx context.Context, owner, repo string) (*github.Repository, *github.Response, error) createRepo(ctx context.Context, owner string, req *github.Repository) (*github.Repository, *github.Response, error) setToken(token string) error diff --git a/pkg/controllers/gitrepository/github.go b/pkg/controllers/gitrepository/github.go index 6766f4ba..ba21a27b 100644 --- a/pkg/controllers/gitrepository/github.go +++ b/pkg/controllers/gitrepository/github.go @@ -38,7 +38,7 @@ func (g *ghClient) setToken(token string) error { type gitHubProvider struct { client.Client Scheme *runtime.Scheme - gitHubClient gitHubClientI + gitHubClient gitHubClient config util.CorePackageTemplateConfig } @@ -106,7 +106,7 @@ func (g *gitHubProvider) updateRepoContent(ctx context.Context, repo *v1alpha1.G return updateRepoContent(ctx, repo, repoInfo, creds, g.Scheme, g.config) } -func newGitHubClient(httpClient *http.Client) gitHubClientI { +func newGitHubClient(httpClient *http.Client) gitHubClient { return &ghClient{ c: github.NewClient(httpClient), } diff --git a/pkg/controllers/localbuild/controller.go b/pkg/controllers/localbuild/controller.go index dc9b4259..47b67182 100644 --- a/pkg/controllers/localbuild/controller.go +++ b/pkg/controllers/localbuild/controller.go @@ -31,6 +31,10 @@ const ( defaultArgoCDProjectName string = "default" ) +var ( + defaultRequeueTime = time.Second * 30 +) + type LocalbuildReconciler struct { client.Client Scheme *runtime.Scheme @@ -151,7 +155,7 @@ func (r *LocalbuildReconciler) ReconcileArgoAppsWithGitea(ctx context.Context, r } r.shouldShutdown = shutdown - return ctrl.Result{RequeueAfter: time.Second * 15}, nil + return ctrl.Result{RequeueAfter: defaultRequeueTime}, nil } func (r *LocalbuildReconciler) reconcileEmbeddedApp(ctx context.Context, appName string, resource *v1alpha1.Localbuild) (ctrl.Result, error) {