Remove DeprecatedMightBeMasterNode()

This removes DeprecatedGetMasterAndWorkerNodes() usage from vsphere e2e
test as deprecated function cleanup.
Then all callers of DeprecatedMightBeMasterNode() have been removed.
So this removes DeprecatedMightBeMasterNode() itself also.
This commit is contained in:
Kenichi Omichi
2020-07-06 23:28:20 +00:00
parent c9c5c23634
commit 029b2d2197
6 changed files with 27 additions and 136 deletions

View File

@@ -41,9 +41,6 @@ import (
clientset "k8s.io/client-go/kubernetes"
clientretry "k8s.io/client-go/util/retry"
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
// TODO remove the direct dependency for internal k8s.io/kubernetes
"k8s.io/kubernetes/test/e2e/system"
)
const (
@@ -363,25 +360,6 @@ func GetReadyNodesIncludingTainted(c clientset.Interface) (nodes *v1.NodeList, e
return nodes, nil
}
// DeprecatedGetMasterAndWorkerNodes will return a list masters and schedulable worker nodes
// NOTE: This function has been deprecated because of calling DeprecatedMightBeMasterNode().
func DeprecatedGetMasterAndWorkerNodes(c clientset.Interface) (sets.String, *v1.NodeList, error) {
nodes := &v1.NodeList{}
masters := sets.NewString()
all, err := c.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{})
if err != nil {
return nil, nil, fmt.Errorf("get nodes error: %s", err)
}
for _, n := range all.Items {
if system.DeprecatedMightBeMasterNode(n.Name) {
masters.Insert(n.Name)
} else if isNodeSchedulableWithoutTaints(&n) {
nodes.Items = append(nodes.Items, n)
}
}
return masters, nodes, nil
}
// isNodeUntainted tests whether a fake pod can be scheduled on "node", given its current taints.
// TODO: need to discuss wether to return bool and error type
func isNodeUntainted(node *v1.Node) bool {