Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TimeoutError = "timeout waiting on condition" WatchConnectionError = "error with watch connection" )
Functions ¶
func WatchWait ¶
func WatchWait(watchInterface watch.Interface, check WatchCheckFunc) error
WatchWait uses the `watchInterface` to wait until the `check` function to returns true. e.g. WatchWait for provisioning a cluster
result, err := r.client.Provisioning.Clusters(namespace).Watch(context.TODO(), metav1.ListOptions{ FieldSelector: "metadata.name=" + clusterName, TimeoutSeconds: &defaults.WatchTimeoutSeconds, }) require.NoError(r.T(), err) err = wait.WatchWait(result, checkFunc)
Types ¶
type WatchCheckFunc ¶
WatchCheckFunc is the function type of `check` needed for WatchWait e.g.
checkFunc := func(event watch.Event) (ready bool, err error) { cluster := event.Object.(*apisV1.Cluster) ready = cluster.Status.Ready return ready, nil }
Click to show internal directories.
Click to hide internal directories.