wait: ExponentialBackoffWithContext should take context-aware fn
The condition methods will eventually all take a context. Since we have been provided one, alter the accepted condition type and change the four references in tree. Collers of ExponentialBackoffWithContext should use a condition aware function (ConditionWithContextFunc). If the context can be ignored the helper ConditionFunc.WithContext can be used to convert an existing function to the new type.
This commit is contained in:
@@ -673,7 +673,7 @@ func waitForDetachAndGrabMetrics(ctx context.Context, oldMetrics *storageControl
|
||||
oldDetachCount = 0
|
||||
}
|
||||
|
||||
verifyMetricFunc := func() (bool, error) {
|
||||
verifyMetricFunc := func(ctx context.Context) (bool, error) {
|
||||
updatedMetrics, err := metricsGrabber.GrabFromControllerManager(ctx)
|
||||
|
||||
if err != nil {
|
||||
@@ -821,7 +821,7 @@ func waitForPVControllerSync(ctx context.Context, metricsGrabber *e2emetrics.Gra
|
||||
Factor: 1.2,
|
||||
Steps: 21,
|
||||
}
|
||||
verifyMetricFunc := func() (bool, error) {
|
||||
verifyMetricFunc := func(ctx context.Context) (bool, error) {
|
||||
updatedMetrics, err := metricsGrabber.GrabFromControllerManager(ctx)
|
||||
if err != nil {
|
||||
framework.Logf("Error fetching controller-manager metrics")
|
||||
@@ -866,7 +866,7 @@ func waitForADControllerStatesMetrics(ctx context.Context, metricsGrabber *e2eme
|
||||
Factor: 1.2,
|
||||
Steps: 21,
|
||||
}
|
||||
verifyMetricFunc := func() (bool, error) {
|
||||
verifyMetricFunc := func(ctx context.Context) (bool, error) {
|
||||
updatedMetrics, err := metricsGrabber.GrabFromControllerManager(ctx)
|
||||
if err != nil {
|
||||
e2eskipper.Skipf("Could not get controller-manager metrics - skipping")
|
||||
|
Reference in New Issue
Block a user