vmware-archive / kubecfg

A tool for managing complex enterprise Kubernetes environments as code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle client-go warnings

anguslees opened this issue · comments

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/