Documentation ¶
Index ¶
- func AddOrUpdateTaintOnNode(c clientset.Interface, nodeName string, taint v1.Taint)
- func CheckReady(c clientset.Interface, size int, timeout time.Duration) ([]v1.Node, error)
- func CheckReadyForTests(c clientset.Interface, nonblockingTaints string, ...) func() (bool, error)
- func CollectAddresses(nodes *v1.NodeList, addressType v1.NodeAddressType) []string
- func CreatePodsPerNodeForSimpleApp(c clientset.Interface, namespace, appName string, ...) map[string]string
- func Filter(nodeList *v1.NodeList, fn func(node v1.Node) bool)
- func FirstAddress(nodelist *v1.NodeList, addrType v1.NodeAddressType) string
- func FirstAddressByTypeAndFamily(nodelist *v1.NodeList, addrType v1.NodeAddressType, family v1.IPFamily) string
- func GetAddresses(node *v1.Node, addressType v1.NodeAddressType) (ips []string)
- func GetAddressesByTypeAndFamily(node *v1.Node, addressType v1.NodeAddressType, family v1.IPFamily) (ips []string)
- func GetBoundedReadySchedulableNodes(c clientset.Interface, maxNodes int) (nodes *v1.NodeList, err error)
- func GetClusterZones(c clientset.Interface) (sets.String, error)
- func GetExternalIP(node *v1.Node) (string, error)
- func GetInternalIP(node *v1.Node) (string, error)
- func GetPublicIps(c clientset.Interface) ([]string, error)
- func GetRandomReadySchedulableNode(c clientset.Interface) (*v1.Node, error)
- func GetReadyNodesIncludingTainted(c clientset.Interface) (nodes *v1.NodeList, err error)
- func GetReadySchedulableNodes(c clientset.Interface) (nodes *v1.NodeList, err error)
- func GetSchedulableClusterZones(c clientset.Interface) (sets.String, error)
- func IsConditionSetAsExpected(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool
- func IsConditionSetAsExpectedSilent(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool
- func IsNodeReady(node *v1.Node) bool
- func IsNodeSchedulable(node *v1.Node) bool
- func NewRuntimeClassPod(runtimeClassName string) *v1.Pod
- func PickIP(c clientset.Interface) (string, error)
- func PreconfiguredRuntimeClassHandler(handler string) string
- func RemoveTaintOffNode(c clientset.Interface, nodeName string, taint v1.Taint)
- func RemoveTaintsOffNode(c clientset.Interface, nodeName string, taints []v1.Taint)
- func TotalReady(c clientset.Interface) (int, error)
- func TotalRegistered(c clientset.Interface) (int, error)
- func WaitConditionToBe(c clientset.Interface, name string, conditionType v1.NodeConditionType, ...) bool
- func WaitForNodeToBeNotReady(c clientset.Interface, name string, timeout time.Duration) bool
- func WaitForNodeToBeReady(c clientset.Interface, name string, timeout time.Duration) bool
- func WaitForReadyNodes(c clientset.Interface, size int, timeout time.Duration) error
- func WaitForTotalHealthy(c clientset.Interface, timeout time.Duration) error
- type PodNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOrUpdateTaintOnNode ¶ added in v1.19.0
AddOrUpdateTaintOnNode adds the given taint to the given node or updates taint.
func CheckReady ¶
CheckReady waits up to timeout for cluster to has desired size and there is no not-ready nodes in it. By cluster size we mean number of schedulable Nodes.
func CheckReadyForTests ¶ added in v1.17.0
func CheckReadyForTests(c clientset.Interface, nonblockingTaints string, allowedNotReadyNodes, largeClusterThreshold int) func() (bool, error)
CheckReadyForTests returns a function which will return 'true' once the number of ready nodes is above the allowedNotReadyNodes threshold (i.e. to be used as a global gate for starting the tests).
func CollectAddresses ¶
func CollectAddresses(nodes *v1.NodeList, addressType v1.NodeAddressType) []string
CollectAddresses returns a list of addresses of the given addressType for the given list of nodes
func CreatePodsPerNodeForSimpleApp ¶ added in v1.19.0
func CreatePodsPerNodeForSimpleApp(c clientset.Interface, namespace, appName string, podSpec func(n v1.Node) v1.PodSpec, maxCount int) map[string]string
CreatePodsPerNodeForSimpleApp creates pods w/ labels. Useful for tests which make a bunch of pods w/o any networking.
func Filter ¶
Filter filters nodes in NodeList in place, removing nodes that do not satisfy the given condition
func FirstAddress ¶
func FirstAddress(nodelist *v1.NodeList, addrType v1.NodeAddressType) string
FirstAddress returns the first address of the given type of each node.
func FirstAddressByTypeAndFamily ¶ added in v1.20.0
func FirstAddressByTypeAndFamily(nodelist *v1.NodeList, addrType v1.NodeAddressType, family v1.IPFamily) string
FirstAddressByTypeAndFamily returns the first address that matches the given type and family of the list of nodes
func GetAddresses ¶
func GetAddresses(node *v1.Node, addressType v1.NodeAddressType) (ips []string)
GetAddresses returns a list of addresses of the given addressType for the given node
func GetAddressesByTypeAndFamily ¶ added in v1.20.0
func GetAddressesByTypeAndFamily(node *v1.Node, addressType v1.NodeAddressType, family v1.IPFamily) (ips []string)
GetAddressesByTypeAndFamily returns a list of addresses of the given addressType for the given node and filtered by IPFamily
func GetBoundedReadySchedulableNodes ¶ added in v1.17.0
func GetBoundedReadySchedulableNodes(c clientset.Interface, maxNodes int) (nodes *v1.NodeList, err error)
GetBoundedReadySchedulableNodes is like GetReadySchedulableNodes except that it returns at most maxNodes nodes. Use this to keep your test case from blowing up when run on a large cluster.
func GetClusterZones ¶ added in v1.19.0
GetClusterZones returns the values of zone label collected from all nodes.
func GetExternalIP ¶
GetExternalIP returns node external IP concatenated with port 22 for ssh e.g. 1.2.3.4:22
func GetInternalIP ¶
GetInternalIP returns node internal IP
func GetPublicIps ¶
GetPublicIps returns a public IP list of nodes.
func GetRandomReadySchedulableNode ¶ added in v1.17.0
GetRandomReadySchedulableNode gets a single randomly-selected node which is available for running pods on. If there are no available nodes it will return an error.
func GetReadyNodesIncludingTainted ¶
GetReadyNodesIncludingTainted returns all ready nodes, even those which are tainted. There are cases when we care about tainted nodes E.g. in tests related to nodes with gpu we care about nodes despite presence of nvidia.com/gpu=present:NoSchedule taint
func GetReadySchedulableNodes ¶ added in v1.17.0
GetReadySchedulableNodes addresses the common use case of getting nodes you can do work on. 1) Needs to be schedulable. 2) Needs to be ready. If EITHER 1 or 2 is not true, most tests will want to ignore the node entirely. If there are no nodes that are both ready and schedulable, this will return an error.
func GetSchedulableClusterZones ¶ added in v1.21.9
GetSchedulableClusterZones returns the values of zone label collected from all nodes which are schedulable.
func IsConditionSetAsExpected ¶
func IsConditionSetAsExpected(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool
IsConditionSetAsExpected returns a wantTrue value if the node has a match to the conditionType, otherwise returns an opposite value of the wantTrue with detailed logging.
func IsConditionSetAsExpectedSilent ¶
func IsConditionSetAsExpectedSilent(node *v1.Node, conditionType v1.NodeConditionType, wantTrue bool) bool
IsConditionSetAsExpectedSilent returns a wantTrue value if the node has a match to the conditionType, otherwise returns an opposite value of the wantTrue.
func IsNodeReady ¶ added in v1.17.0
IsNodeReady returns true if: 1) it's Ready condition is set to true 2) doesn't have NetworkUnavailable condition set to true
func IsNodeSchedulable ¶ added in v1.17.0
IsNodeSchedulable returns true if: 1) doesn't have "unschedulable" field set 2) it also returns true from IsNodeReady
func NewRuntimeClassPod ¶ added in v1.18.0
NewRuntimeClassPod returns a test pod with the given runtimeClassName
func PreconfiguredRuntimeClassHandler ¶ added in v1.18.0
PreconfiguredRuntimeClassHandler returns configured runtime handler.
func RemoveTaintOffNode ¶ added in v1.19.0
RemoveTaintOffNode removes the given taint from the given node.
func RemoveTaintsOffNode ¶ added in v1.21.0
RemoveTaintsOffNode removes a list of taints from the given node It is simply a helper wrapper for RemoveTaintOffNode
func TotalReady ¶
TotalReady returns number of ready schedulable Nodes.
func TotalRegistered ¶
TotalRegistered returns number of schedulable Nodes.
func WaitConditionToBe ¶
func WaitConditionToBe(c clientset.Interface, name string, conditionType v1.NodeConditionType, wantTrue bool, timeout time.Duration) bool
WaitConditionToBe returns whether node "name's" condition state matches wantTrue within timeout. If wantTrue is true, it will ensure the node condition status is ConditionTrue; if it's false, it ensures the node condition is in any state other than ConditionTrue (e.g. not true or unknown).
func WaitForNodeToBeNotReady ¶
WaitForNodeToBeNotReady returns whether node name is not ready (i.e. the readiness condition is anything but ready, e.g false or unknown) within timeout.
func WaitForNodeToBeReady ¶
WaitForNodeToBeReady returns whether node name is ready within timeout.
func WaitForReadyNodes ¶
WaitForReadyNodes waits up to timeout for cluster to has desired size and there is no not-ready nodes in it. By cluster size we mean number of schedulable Nodes.