diff --git a/pkg/controller/volume/persistentvolume/pv_controller_test.go b/pkg/controller/volume/persistentvolume/pv_controller_test.go index 876af6a8166..3fee6f6aafc 100644 --- a/pkg/controller/volume/persistentvolume/pv_controller_test.go +++ b/pkg/controller/volume/persistentvolume/pv_controller_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/watch" @@ -260,12 +260,14 @@ func TestControllerSync(t *testing.T) { reactor := newVolumeReactor(client, ctrl, fakeVolumeWatch, fakeClaimWatch, test.errors) for _, claim := range test.initialClaims { + claim = claim.DeepCopy() reactor.AddClaim(claim) go func(claim *v1.PersistentVolumeClaim) { fakeClaimWatch.Add(claim) }(claim) } for _, volume := range test.initialVolumes { + volume = volume.DeepCopy() reactor.AddVolume(volume) go func(volume *v1.PersistentVolume) { fakeVolumeWatch.Add(volume)