mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
Wire contexts to Core controllers
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package persistentvolume
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
@@ -490,11 +491,11 @@ func claimWithAccessMode(modes []v1.PersistentVolumeAccessMode, claims []*v1.Per
|
||||
}
|
||||
|
||||
func testSyncClaim(ctrl *PersistentVolumeController, reactor *pvtesting.VolumeReactor, test controllerTest) error {
|
||||
return ctrl.syncClaim(test.initialClaims[0])
|
||||
return ctrl.syncClaim(context.TODO(), test.initialClaims[0])
|
||||
}
|
||||
|
||||
func testSyncClaimError(ctrl *PersistentVolumeController, reactor *pvtesting.VolumeReactor, test controllerTest) error {
|
||||
err := ctrl.syncClaim(test.initialClaims[0])
|
||||
err := ctrl.syncClaim(context.TODO(), test.initialClaims[0])
|
||||
|
||||
if err != nil {
|
||||
return nil
|
||||
@@ -503,7 +504,7 @@ func testSyncClaimError(ctrl *PersistentVolumeController, reactor *pvtesting.Vol
|
||||
}
|
||||
|
||||
func testSyncVolume(ctrl *PersistentVolumeController, reactor *pvtesting.VolumeReactor, test controllerTest) error {
|
||||
return ctrl.syncVolume(test.initialVolumes[0])
|
||||
return ctrl.syncVolume(context.TODO(), test.initialVolumes[0])
|
||||
}
|
||||
|
||||
type operationType string
|
||||
@@ -797,7 +798,7 @@ func runMultisyncTests(t *testing.T, tests []controllerTest, storageClasses []*s
|
||||
claim := obj.(*v1.PersistentVolumeClaim)
|
||||
// Simulate "claim updated" event
|
||||
ctrl.claims.Update(claim)
|
||||
err = ctrl.syncClaim(claim)
|
||||
err = ctrl.syncClaim(context.TODO(), claim)
|
||||
if err != nil {
|
||||
if err == pvtesting.ErrVersionConflict {
|
||||
// Ignore version errors
|
||||
@@ -814,7 +815,7 @@ func runMultisyncTests(t *testing.T, tests []controllerTest, storageClasses []*s
|
||||
volume := obj.(*v1.PersistentVolume)
|
||||
// Simulate "volume updated" event
|
||||
ctrl.volumes.store.Update(volume)
|
||||
err = ctrl.syncVolume(volume)
|
||||
err = ctrl.syncVolume(context.TODO(), volume)
|
||||
if err != nil {
|
||||
if err == pvtesting.ErrVersionConflict {
|
||||
// Ignore version errors
|
||||
|
||||
Reference in New Issue
Block a user