const sleepTime … var requiredPerNodePods … // 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. func WaitForReadyNodes(ctx context.Context, c clientset.Interface, size int, timeout time.Duration) error { … } // WaitForTotalHealthy checks whether all registered nodes are ready and all required Pods are running on them. func WaitForTotalHealthy(ctx context.Context, c clientset.Interface, timeout time.Duration) error { … } // 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 WaitConditionToBe(ctx context.Context, c clientset.Interface, name string, conditionType v1.NodeConditionType, wantTrue bool, timeout time.Duration) bool { … } // 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 WaitForNodeToBeNotReady(ctx context.Context, c clientset.Interface, name string, timeout time.Duration) bool { … } // WaitForNodeToBeReady returns whether node name is ready within timeout. func WaitForNodeToBeReady(ctx context.Context, c clientset.Interface, name string, timeout time.Duration) bool { … } func WaitForNodeSchedulable(ctx context.Context, c clientset.Interface, name string, timeout time.Duration, wantSchedulable bool) bool { … } // WaitForNodeHeartbeatAfter waits up to timeout for node to send the next // heartbeat after the given timestamp. // // To ensure the node status is posted by a restarted kubelet process, // after should be retrieved by [GetNodeHeartbeatTime] while the kubelet is down. func WaitForNodeHeartbeatAfter(ctx context.Context, c clientset.Interface, name string, after metav1.Time, timeout time.Duration) { … } // 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 CheckReady(ctx context.Context, c clientset.Interface, size int, timeout time.Duration) ([]v1.Node, error) { … } // waitListSchedulableNodes is a wrapper around listing nodes supporting retries. func waitListSchedulableNodes(ctx context.Context, c clientset.Interface) (*v1.NodeList, error) { … } // checkWaitListSchedulableNodes is a wrapper around listing nodes supporting retries. func checkWaitListSchedulableNodes(ctx context.Context, c clientset.Interface) (*v1.NodeList, 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 CheckReadyForTests(ctx context.Context, c clientset.Interface, nonblockingTaints string, allowedNotReadyNodes, largeClusterThreshold int) func(ctx context.Context) (bool, error) { … } // readyForTests determines whether or not we should continue waiting for the nodes // to enter a testable state. By default this means it is schedulable, NodeReady, and untainted. // Nodes with taints nonblocking taints are permitted to have that taint and // also have their node.Spec.Unschedulable field ignored for the purposes of this function. func readyForTests(node *v1.Node, nonblockingTaints string) bool { … }