type nodeTree … // newNodeTree creates a NodeTree from nodes. func newNodeTree(logger klog.Logger, nodes []*v1.Node) *nodeTree { … } // addNode adds a node and its corresponding zone to the tree. If the zone already exists, the node // is added to the array of nodes in that zone. func (nt *nodeTree) addNode(logger klog.Logger, n *v1.Node) { … } // removeNode removes a node from the NodeTree. func (nt *nodeTree) removeNode(logger klog.Logger, n *v1.Node) error { … } // removeZone removes a zone from tree. // This function must be called while writer locks are hold. func (nt *nodeTree) removeZone(zone string) { … } // updateNode updates a node in the NodeTree. func (nt *nodeTree) updateNode(logger klog.Logger, old, new *v1.Node) { … } // list returns the list of names of the node. NodeTree iterates over zones and in each zone iterates // over nodes in a round robin fashion. func (nt *nodeTree) list() ([]string, error) { … }