Skip to content

Commit

Permalink
better comments and interface name
Browse files Browse the repository at this point in the history
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
  • Loading branch information
somtochiama committed Dec 6, 2023
1 parent 5d98dd6 commit f6e1113
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ var (
ErrReconciledWithWarning = errors.New("reconciled with warning")
)

// Reconciler interface wraps functions that reconciles and reports the health of different
// Reconciler reconciles and reports the health of different
// components and kubernetes resources involved in the installation of Flux.
//
// Deprecated: Please use the `ReconcilerWithGitRepoHealth` interface that also
// reports the health of the GitRepository
// It is recommended use the `ReconcilerWithSyncCheck` interface that also reports the health of the GitRepository.
type Reconciler interface {
// ReconcileComponents reconciles the components by generating the
// manifests with the provided values, committing them to Git and
Expand Down Expand Up @@ -84,9 +83,9 @@ type RepositoryReconciler interface {
ReconcileRepository(ctx context.Context) error
}

// ReconcilerWithGitRepoHealth extends the Reconciler interface to also report the health of the GitReposiotry
// ReconcilerWithSyncCheck extends the Reconciler interface to also report the health of the GitReposiotry
// that syncs Flux on the cluster
type ReconcilerWithGitRepoHealth interface {
type ReconcilerWithSyncCheck interface {
Reconciler
// ReportGitRepoHealth reports about the health of the GitRepository synchronizing the components.
ReportGitRepoHealth(ctx context.Context, options sync.Options, pollInterval, timeout time.Duration) error
Expand Down Expand Up @@ -116,7 +115,7 @@ func Run(ctx context.Context, reconciler Reconciler, manifestsBase string,
}

var errs []error
if r, ok := reconciler.(ReconcilerWithGitRepoHealth); ok {
if r, ok := reconciler.(ReconcilerWithSyncCheck); ok {
if err := r.ReportGitRepoHealth(ctx, syncOpts, pollInterval, timeout); err != nil {
errs = append(errs, err)
}
Expand Down

0 comments on commit f6e1113

Please sign in to comment.