-
Notifications
You must be signed in to change notification settings - Fork 104
Description
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-runtimeclient, which is intended to be used in an operator, such as the OF operator. The controller runtime has the requirement of thelog.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 startingflagd-proxy, waiting 30 seconds, and then doing a call toSyncFlags, resulting in the message being shown. IfSyncFlagsis 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 offlagd-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 theclient-golibrary will require making some changes in the usage of the client, but could be done with relatively low effort imho.
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)