removing data races
@@ -580,9 +580,6 @@ func (worker *gardenWorker) cloneRemoteVolumes(
for i, nonLocalInput := range nonLocals {
// this is to ensure each go func gets its own non changing copy of the iterator
i, nonLocalInput := i, nonLocalInput
-
- g.Go(func() error {
-
inputVolume, err := worker.volumeClient.FindOrCreateVolumeForContainer(
logger,
VolumeSpec{
@@ -594,14 +591,14 @@ func (worker *gardenWorker) cloneRemoteVolumes(
nonLocalInput.desiredMountPath,
)
if err != nil {
- return err
+ return []VolumeMount{}, err
}
-
destData := lager.Data{
"dest-volume": inputVolume.Handle(),
"dest-worker": inputVolume.WorkerName(),
}
+ g.Go(func() error {
err = nonLocalInput.desiredArtifact.StreamTo(logger.Session("stream-to", destData), inputVolume)
if err != nil {
return err
