mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-21 15:11:47 +00:00
Merge pull request #3085 from souleb/reconcile-repository
[bootstrap] Make sure we reconcile with the right reconciliation method
This commit is contained in:
commit
0c817378cf
1 changed files with 2 additions and 8 deletions
|
|
@ -298,11 +298,8 @@ func (b *GitProviderBootstrapper) reconcileOrgRepository(ctx context.Context) (g
|
||||||
|
|
||||||
var changed bool
|
var changed bool
|
||||||
if b.reconcile {
|
if b.reconcile {
|
||||||
// Set default branch before calling Reconcile due to bug described
|
|
||||||
// above.
|
|
||||||
repoInfo.DefaultBranch = repo.Get().DefaultBranch
|
|
||||||
if err = retry(1, 2*time.Second, func() (err error) {
|
if err = retry(1, 2*time.Second, func() (err error) {
|
||||||
repo, changed, err = b.provider.OrgRepositories().Reconcile(ctx, repoRef, repoInfo)
|
changed, err = repo.Reconcile(ctx)
|
||||||
return
|
return
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return nil, fmt.Errorf("failed to reconcile Git repository %q: %w", repoRef.String(), err)
|
return nil, fmt.Errorf("failed to reconcile Git repository %q: %w", repoRef.String(), err)
|
||||||
|
|
@ -373,12 +370,9 @@ func (b *GitProviderBootstrapper) reconcileUserRepository(ctx context.Context) (
|
||||||
}
|
}
|
||||||
|
|
||||||
if b.reconcile {
|
if b.reconcile {
|
||||||
// Set default branch before calling Reconcile due to bug described
|
|
||||||
// above.
|
|
||||||
repoInfo.DefaultBranch = repo.Get().DefaultBranch
|
|
||||||
var changed bool
|
var changed bool
|
||||||
if err = retry(1, 2*time.Second, func() (err error) {
|
if err = retry(1, 2*time.Second, func() (err error) {
|
||||||
repo, changed, err = b.provider.UserRepositories().Reconcile(ctx, repoRef, repoInfo)
|
changed, err = repo.Reconcile(ctx)
|
||||||
return
|
return
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return nil, fmt.Errorf("failed to reconcile Git repository %q: %w", repoRef.String(), err)
|
return nil, fmt.Errorf("failed to reconcile Git repository %q: %w", repoRef.String(), err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue