in internal/controller/pdb_to_evictionautoscaler_controller.go [110:124]
func (r *PDBToEvictionAutoScalerReconciler) SetupWithManager(mgr ctrl.Manager) error {
// Set up the controller to watch Deployments and trigger the reconcile function
return ctrl.NewControllerManagedBy(mgr).
For(&policyv1.PodDisruptionBudget{}).
WithEventFilter(predicate.Funcs{
// Only trigger for Create and Delete events
UpdateFunc: func(e event.UpdateEvent) bool {
//ToDo: theoretically you could have a pdb update and change
// its label selectors in which case you might need to update the deployment target?
return false
},
}).
Owns(&types.EvictionAutoScaler{}). // Watch EvictionAutoScalers for ownership
Complete(r)
}