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:
Clayton Coleman
2023-01-16 14:57:57 -05:00
parent 7b01daba71
commit 34bfdc3635
4 changed files with 7 additions and 7 deletions

View File

@@ -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")