Refactor: use Kubernetes.Interface instead of *Clientset

So we can call with a mock for testing
This commit is contained in:
Bryan Boreham committed 2018-09-12 12:35:34 +00:00
1 parent 7dcd4bdf47
commit c3ce052cc5
4 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@ type nodeInfo struct {
}
// return the IP addresses of all nodes in the cluster
func getKubePeers(c *kubernetes.Clientset, includeWithNoIPAddr bool) ([]nodeInfo, error) {
func getKubePeers(c kubernetes.Interface, includeWithNoIPAddr bool) ([]nodeInfo, error) {
nodeList, err := c.CoreV1().Nodes().List(api.ListOptions{})
if err != nil {
return nil, err