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, addMSCNodes bool)
- type Filter
- type Mode
- type ZoneGetter
- func (z *ZoneGetter) IsDefaultSubnetNode(nodeName string, logger klog.Logger) (bool, error)
- func (z *ZoneGetter) IsNodeSelectedByFilter(node *api_v1.Node, filter Filter, filterLogger klog.Logger) bool
- func (z *ZoneGetter) ListNodes(filter Filter, logger klog.Logger) ([]*api_v1.Node, error)
- func (z *ZoneGetter) ListZones(filter Filter, logger klog.Logger) ([]string, error)
- func (z *ZoneGetter) ZoneAndSubnetForNode(name string, logger klog.Logger) (string, string, error)
Constants ¶
const ( AllNodesFilter = Filter("AllNodesFilter") CandidateNodesFilter = Filter("CandidateNodesFilter") CandidateAndUnreadyNodesFilter = Filter("CandidateAndUnreadyNodesFilter") )
Variables ¶
var ErrNodeNotFound = errors.New("node not found")
var ErrNodeNotInDefaultSubnet = errors.New("Node not in default subnet")
var ErrNodePodCIDRNotSet = errors.New("Node does not have PodCIDR set")
var ErrProviderIDNotFound = errors.New("providerID not found")
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, addMSCNodes bool)
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 NewFakeZoneGetter ¶ added in v1.30.0
func NewFakeZoneGetter(nodeInformer cache.SharedIndexInformer, defaultSubnetURL string, onlyIncludeDefaultSubnetNodes bool) *ZoneGetter
NewFakeZoneGetter initialize a fake ZoneGetter in GCP mode to use in test.
func NewNonGCPZoneGetter ¶
func NewNonGCPZoneGetter(zone string) *ZoneGetter
NewNonGCPZoneGetter initialize a ZoneGetter in Non-GCP mode.
func NewZoneGetter ¶
func NewZoneGetter(nodeInformer cache.SharedIndexInformer, defaultSubnetURL string) *ZoneGetter
NewZoneGetter initialize a ZoneGetter in GCP mode.
func (*ZoneGetter) IsDefaultSubnetNode ¶ added in v1.30.0
func (z *ZoneGetter) IsDefaultSubnetNode(nodeName string, logger klog.Logger) (bool, error)
ZoneForNode returns if the given node is in default subnet.
func (*ZoneGetter) IsNodeSelectedByFilter ¶ added in v1.30.0
func (z *ZoneGetter) IsNodeSelectedByFilter(node *api_v1.Node, filter Filter, filterLogger klog.Logger) bool
IsNodeSelectedByFilter checks if the node matches the node filter mode.
func (*ZoneGetter) ListNodes ¶ added in v1.30.0
func (z *ZoneGetter) ListNodes(filter Filter, logger klog.Logger) ([]*api_v1.Node, error)
ListNodes returns a list of nodes that satisfy the given node filtering mode.
func (*ZoneGetter) ListZones ¶ added in v1.30.0
func (z *ZoneGetter) ListZones(filter Filter, logger klog.Logger) ([]string, error)
ListZones returns a list of zones containing nodes that satisfy the given node filtering mode.
func (*ZoneGetter) ZoneAndSubnetForNode ¶ added in v1.32.0
func (z *ZoneGetter) ZoneAndSubnetForNode(name string, logger klog.Logger) (string, string, error)
ZoneAndSubnetForNode returns the zone and subnet for a given node by looking up providerID.