nginx/nginx-supportpkg-for-k8s

Program terminates with stacktrace if clients fail to initialize

Closed this issue · 2 comments

Describe the bug
The program ends with a nil reference error if any of the clients in the initialization data collector section. We need to verify the errors the client constructors might return.

To Reproduce
Steps to reproduce the behavior:

  1. Create a wrong .kube/config data.
  2. Run the plugin

Expected behavior
Program should gracefully fail and indicate the error reason.

I am unable to reproduce this.
I cloned a working .kube/config and deleted an item e.g.: client-certificate-data:

kic-0: namespaces "kic-0" is forbidden: User "system:anonymous" cannot get resource "namespaces" in API group "" in the namespace "kic-0"

or certificate-authority-data::

kic-0: Get "https://10.146.180.184:443/api/v1/namespaces/kic-0": tls: failed to verify certificate: x509: “kube-apiserver” certificate is not trusted
 Error: Some namespaces do not exist

Perhaps a copy of the .kube/config may be handy to repro.

Closed as non-reproducible.