Using Event Filters with Kubebuilder

Part 1: Filtering Deletes

UPDATE (2020/01/08 ): After testing this in another project I discovered that the NotFound checking is still required in the case where the reconciliation has been requeued and the object is deleted in the interim period. Even with this code, I still prefer not having the NotFound output in my logs for the default case.

Background

A couple of projects recently have involved using Kubebuilder to create Kubernetes operators.

Kubebuilder scaffolds out a go application and then lets you focus on writing the logic of the reconciliation loop which is the core part of the operator. For getting started with Kubebuilder there is Kubebuilder book which is a great walkthrough of creating a controller.

[Read More]