Refactor: use Kubernetes.Interface instead of *Clientset
So we can call with a mock for testing
This commit is contained in:
1 parent
7dcd4bdf47
commit
c3ce052cc5
4 files changed
+6
-6
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user