Skip to content

Commit

Permalink
fix: reorder operations in ReleasePlan controller
Browse files Browse the repository at this point in the history
This commit reorders the operations in the ReleasePlan controller so
that the application owner reference is set last. If the application is
not found, the reconcile loop errors. This means that if the application
is not yet created, the other operations will not run, and (at this
time) no matching information will be set. With this commit, the
matching information is set before, as this does not rely on the
application CR existing.

Signed-off-by: Johnny Bieren <[email protected]>
  • Loading branch information
johnbieren committed Jan 23, 2024
1 parent 0eb0a45 commit bc0fff6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/releaseplan/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ func (c *Controller) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
adapter := newAdapter(ctx, c.client, releasePlan, loader.NewLoader(), &logger)

return controller.ReconcileHandler([]controller.Operation{
adapter.EnsureOwnerReferenceIsSet,
adapter.EnsureMatchingInformationIsSet,
adapter.EnsureOwnerReferenceIsSet,

Check warning on line 67 in controllers/releaseplan/controller.go

View check run for this annotation

Codecov / codecov/patch

controllers/releaseplan/controller.go#L67

Added line #L67 was not covered by tests
})
}

Expand Down

0 comments on commit bc0fff6

Please sign in to comment.