INNER CODE UNIT · Go
func
k8gb-io/k8gb · controllers/bootstrap_controller_setup.go:38
func (r *CoreDNSReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
Named("k8gb-coredns").
Watches(
&corev1.Service{},
handler.EnqueueRequestsFromMapFunc(watcher),
builder.WithPredicates(pFuncs(assistant.CoreDNSServiceLabelName, assistant.CoreDNSServiceLabelValue))).
Watches(
&netv1.Ingress{},
handler.EnqueueRequestsFromMapFunc(watcher),
builder.WithPredicates(pFuncs(assistant.IngressLabelName, assistant.IngressLabelValue))).
Complete(r)
}
func watcher(_ context.Context, obj client.Object) []reconcile.Request {
return []reconcile.Request{{
NamespacedName: types.NamespacedName{
Namespace: obj.GetNamespace(),