Skip to content

Commit

Permalink
and Sequence
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Andrews <andrewssc@vmware.com>
  • Loading branch information
scothis committed May 9, 2022
1 parent a129b98 commit eccd58d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions reconcilers/reconcilers.go
Expand Up @@ -1091,7 +1091,11 @@ func (r *ChildReconciler) ourChild(parent, obj client.Object) bool {
type Sequence []SubReconciler

func (r Sequence) SetupWithManager(ctx context.Context, mgr ctrl.Manager, bldr *builder.Builder) error {
for _, reconciler := range r {
for i, reconciler := range r {
log := logr.FromContextOrDiscard(ctx).
WithName(fmt.Sprintf("%d", i))
ctx = logr.NewContext(ctx, log)

err := reconciler.SetupWithManager(ctx, mgr, bldr)
if err != nil {
return err
Expand All @@ -1102,7 +1106,11 @@ func (r Sequence) SetupWithManager(ctx context.Context, mgr ctrl.Manager, bldr *

func (r Sequence) Reconcile(ctx context.Context, parent client.Object) (ctrl.Result, error) {
aggregateResult := ctrl.Result{}
for _, reconciler := range r {
for i, reconciler := range r {
log := logr.FromContextOrDiscard(ctx).
WithName(fmt.Sprintf("%d", i))
ctx = logr.NewContext(ctx, log)

result, err := reconciler.Reconcile(ctx, parent)
if err != nil {
return ctrl.Result{}, err
Expand Down

0 comments on commit eccd58d

Please sign in to comment.