diff --git a/support/datastore/gcs_datastore.go b/support/datastore/gcs_datastore.go index c8c22fd57e..76de421566 100644 --- a/support/datastore/gcs_datastore.go +++ b/support/datastore/gcs_datastore.go @@ -162,7 +162,7 @@ func (b GCSDataStore) putFile(ctx context.Context, filePath string, in io.Writer w.SendCRC32C = true // we must set CRC32C before invoking w.Write() for the first time w.CRC32C = crc32.Checksum(buf.Bytes(), crc32.MakeTable(crc32.Castagnoli)) - if _, err := in.WriteTo(buf); err != nil { + if _, err := io.Copy(w, buf); err != nil { return errors.Wrapf(err, "failed to put file: %s", filePath) } return w.Close()