digitalocean / clusterlint

A best practices checker for Kubernetes clusters. 🤠
Apache License 2.0
547 stars 45 forks source link

Load k8s client-go auth plugins #51

Closed ibrasho closed 5 years ago

ibrasho commented 5 years ago

If kubeconfig is configured to use an auth provider (gcp, oauth ... etc) you won't be able to connect to the cluster and will get the dreaded error message: No Auth Provider found for name "AUTH_PROVIDER".

The change is this PR ensure all default auth plugins for k8s.io/client-go are loaded as per this document.

ibrasho commented 5 years ago

The only real change in this PR is this one line: https://github.com/digitalocean/clusterlint/blob/fce09b6aa2280e711cc9da6496729340ad330819/kube/objects.go#L27

Everything else is go modules magic. I'm not sure what's the project policy on go modules vendoring? I vendored everything just incase.

varshavaradarajan commented 5 years ago

@ibrasho - there are no changes to go.mod that's been checked in. Was that missed out accidentally? Edit: Sorry, client-go is already in go.mod

jcodybaker commented 5 years ago

I've confirmed this works on a GKE cluster.