Documentation ¶
Index ¶
- Constants
- Variables
- func AddFakeNode(zoneGetter *ZoneGetter, node *apiv1.Node) error
- func AddFakeNodes(zoneGetter *ZoneGetter, newZone string, instances ...string) error
- func DeleteFakeNodesInZone(t *testing.T, zone string, zoneGetter *ZoneGetter)
- func FakeNodeInformer() cache.SharedIndexInformer
- func PopulateFakeNodeInformer(nodeInformer cache.SharedIndexInformer)
- type Filter
- type Mode
- type ZoneGetter
Constants ¶
View Source
const ( AllNodesFilter = "AllNodesFilter" CandidateNodesFilter = "CandidateNodesFilter" CandidateAndUnreadyNodesFilter = "CandidateAndUnreadyNodesFilter" )
Variables ¶
View Source
var ErrNodeNotFound = errors.New("node not found")
View Source
var ErrProviderIDNotFound = errors.New("providerID not found")
View Source
var ErrSplitProviderID = errors.New("error splitting providerID")
Functions ¶
func AddFakeNode ¶ added in v1.28.0
func AddFakeNode(zoneGetter *ZoneGetter, node *apiv1.Node) error
AddFakeNode adds fake node to the ZoneGetter.
func AddFakeNodes ¶
func AddFakeNodes(zoneGetter *ZoneGetter, newZone string, instances ...string) error
AddFakeNodes adds fake nodes to the ZoneGetter in the provided zone.
func DeleteFakeNodesInZone ¶
func DeleteFakeNodesInZone(t *testing.T, zone string, zoneGetter *ZoneGetter)
DeleteFakeNodesInZone deletes all nodes in a zone.
func FakeNodeInformer ¶
func FakeNodeInformer() cache.SharedIndexInformer
func PopulateFakeNodeInformer ¶
func PopulateFakeNodeInformer(nodeInformer cache.SharedIndexInformer)
PopulateFakeNodeInformer populates a fake node informer with fake nodes.
Types ¶
type ZoneGetter ¶
type ZoneGetter struct {
// contains filtered or unexported fields
}
ZoneGetter manages lookups for GCE instances to zones.
func NewNonGCPZoneGetter ¶
func NewNonGCPZoneGetter(zone string) *ZoneGetter
NewNonGCPZoneGetter initialize a ZoneGetter in Non-GCP mode.
func NewZoneGetter ¶
func NewZoneGetter(nodeInformer cache.SharedIndexInformer) *ZoneGetter
NewZoneGetter initialize a ZoneGetter in GCP mode.
func (*ZoneGetter) List ¶
func (z *ZoneGetter) List(filter Filter, logger klog.Logger) ([]string, error)
List returns a list of zones containing nodes that satisfy the given node filtering mode.
func (*ZoneGetter) ZoneForNode ¶
func (z *ZoneGetter) ZoneForNode(name string, logger klog.Logger) (string, error)
ZoneForNode returns the zone for a given node by looking up providerID.
Click to show internal directories.
Click to hide internal directories.