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
{{ message }}
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
Since fluxd uses client-go, which in turn uses klog for logging, it would be beneficial for fluxd to support setting klog flags from the command line, similar to all other kubernetes components.
I suggest the easiest way to add this functionality is to swap out "github.com/spf13/pflag" with the "flag" package from the standard library. After that, simply calling klog.InitFlags() should add all of its flags to the fluxd flagset.
The text was updated successfully, but these errors were encountered:
Switching to flag is not an option since we depend on specific pflag features. But this is not needed to log the rate limit messages. Klog can be initialised inline and we can pass in a fluxd flag to it that sets the verbosity.
I don't have any strong preference for how klog initialization is handled. I didn't have much success with trying to pass it a *flag.FlagSet populated through pflag flags, but maybe there is something I missed.
Since fluxd uses client-go, which in turn uses klog for logging, it would be beneficial for fluxd to support setting klog flags from the command line, similar to all other kubernetes components.
The log level is particularly useful for troubleshooting since the klog package initializes this to 0.
https://github.com/kubernetes/klog/blob/master/klog.go#L404
fluxd also uses client-go rate-limiting of requests to the kubernetes API server:https://github.com/fluxcd/flux/blob/master/cmd/fluxd/main.go#L375-L376
Doing some research on this, I believe there is currently no means of identifying when requests are in fact being throttled since those messages are logged at verbosity level 4: https://github.com/kubernetes/client-go/blob/master/rest/request.go#L538
I suggest the easiest way to add this functionality is to swap out "github.com/spf13/pflag" with the "flag" package from the standard library. After that, simply calling klog.InitFlags() should add all of its flags to the fluxd flagset.
The text was updated successfully, but these errors were encountered: