You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use client-go library instead of controller-runtime for kubernetes sync implementation. See background:
It seems like this is happening because the kubernetes sync of the flagd-proxy is using the k8s.io/controller-runtime client, which is intended to be used in an operator, such as the OF operator. The controller runtime has the requirement of the log.SetLogger() function to be called within 30 seconds after the application has been started (see [1]), otherwise the error message will be shown. I just verified this be starting flagd-proxy, waiting 30 seconds, and then doing a call to SyncFlags, resulting in the message being shown. If SyncFlags is called within 30 seconds, no error message is printed.
To get rid of this error message we would need to make sure the said log.SetLogger() function is called during startup of flagd-proxy. However, I would recommend to switch to the client go [2] library instead, as this is more intended for this kind of application, whereas using the client from the controller-runtime is a bit of a misuse in this setting.
Switching to the client-go library will require making some changes in the usage of the client, but could be done with relatively low effort imho.
toddbaert
changed the title
Fix warning: log.SetLogger(...) was never called; logs will not be displayed.
Use client-go library instead of controller-runtime for kubernetes sync implementation.
Dec 11, 2023
Use client-go library instead of controller-runtime for kubernetes sync implementation. See background:
Thanks @bacherfl
References:
[1] - https://github.com/kubernetes-sigs/controller-runtime/blob/1ea2be573f7887a9fbd766e9a921c5af344da6eb/pkg/log/log.go#L78
[2] - https://github.com/kubernetes/client-go
Originally posted by @bacherfl in #1063 (comment)
The text was updated successfully, but these errors were encountered: