When I start my manager, I get a lot of lines like this:
E0611 12:55:04.516997 251465 client_go_adapter.go:339] duplicate metrics collector registration attempted
I'm guessing this is because I'm registering several controllers for the same type and each one is trying to use the same metric name.
I'd recommend using the .Name() method on builder if you have multiple controllers for the same type to given them different names. If you still have issues after that, poke this issue and I'll reopen it.
Just in case anyone else stumbles upon this Issue and needs a little more context - I was able to fix this using .Named() when calling SetupWithManager(). For example:
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&mycontrollerv1alpha2.Environment{}).
Named("storage").
Complete(r)
}
Most helpful comment
Just in case anyone else stumbles upon this Issue and needs a little more context - I was able to fix this using
.Named()when callingSetupWithManager(). For example: