INNER CODE UNIT · Go
watcher
k8gb-io/k8gb · controllers/bootstrap_controller_setup.go:52
func watcher(_ context.Context, obj client.Object) []reconcile.Request {
return []reconcile.Request{{
NamespacedName: types.NamespacedName{
Namespace: obj.GetNamespace(),
Name: obj.GetName(),
},
}}
}
func pFuncs(labelName, labelValue string) predicate.Funcs {
return predicate.Funcs{
CreateFunc: func(e event.CreateEvent) bool {
return e.Object.GetLabels()[labelName] == labelValue
},
UpdateFunc: func(e event.UpdateEvent) bool {
return e.ObjectNew.GetLabels()[labelName] == labelValue
},
DeleteFunc: func(e event.DeleteEvent) bool {