vmware-archive / kubecfg

A tool for managing complex enterprise Kubernetes environments as code.
Apache License 2.0
728 stars 62 forks source link

Handle client-go warnings #312

Open anguslees opened 3 years ago

anguslees commented 3 years ago

Kubernetes/client-go now surfaces warnings, by writing directly to stderr by default. This looks a bit ugly:

INFO  Updating clusterrolebindings system:metrics-server
W0831 14:02:35.085715  269861 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+

Since we have our own logger and output formatting, we should hook into client-go's rest.SetDefaultWarningHandler()

See also https://kubernetes.io/blog/2020/09/03/warnings/