Skip to content

Commit

Permalink
Merge pull request #69 from roivaz/fix/deleted-resources-not-reconciled
Browse files Browse the repository at this point in the history
Fix reconcile of deleted resources in namespaced mode
  • Loading branch information
raffaelespazzoli authored Jun 2, 2021
2 parents bc888ed + 0129042 commit 2eaf121
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/util/lockedresourcecontroller/resource-reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ func (p *resourceModifiedPredicate) Delete(e event.DeleteEvent) bool {
err := p.lrr.GetAPIReader().Get(context.TODO(), types.NamespacedName{Name: e.Object.GetNamespace()}, &namespace)
if err != nil {
p.lrr.log.Error(err, "unable to retrieve ", "namespace", "e.Meta.GetNamespace()")
return false
// If the request failed return "true" as the k8s API will deny any create/update operation in a
// Namespace that's marked for termination. Returning false here causes resources not being reconciled
// in namespaced installations (Namespace requires a client with cluster scoped permissions)
return true
}
if util.IsBeingDeleted(&namespace) {
return false
Expand Down

0 comments on commit 2eaf121

Please sign in to comment.