Skip to content

Commit

Permalink
Gitopts reconciler just deletes the Bundle, not BundleDeployments (#2597
Browse files Browse the repository at this point in the history
)

As we are using finalizers for Bundles we can let the Bundle reconciler deal
with its BundleDeployments and just delete the Bundle in the gitopts reconciler.

That way we avoid having race conditions between both reconcilers trying to
delete the same BundleDeployments

Related to: #2586

Signed-off-by: Xavi Garcia <[email protected]>
  • Loading branch information
0xavi0 authored Jul 5, 2024
1 parent 489d4c5 commit b761475
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions internal/cmd/controller/finalize/finalize.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ func PurgeBundles(ctx context.Context, c client.Client, gitrepo types.Namespaced
}

for _, bundle := range bundles.Items {
nn := types.NamespacedName{Namespace: bundle.Namespace, Name: bundle.Name}
if err = PurgeBundleDeployments(ctx, c, nn); err != nil {
return client.IgnoreNotFound(err)
}

// Just delete the bundle and let the Bundle reconciler purge its BundleDeployments
err := c.Delete(ctx, &bundle)
if client.IgnoreNotFound(err) != nil {
return err
Expand Down

0 comments on commit b761475

Please sign in to comment.