build(deps): bump cloud.google.com/go/storage from 1.16.1 to 1.18.1

Bumps [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) from 1.16.1 to 1.18.1.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/master/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/storage/v1.16.1...storage/v1.18.1)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/storage
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2021-10-18 04:42:23 +00:00 committed by Tom Gundersen
parent 51024c482d
commit 9075dbc61d
79 changed files with 4237 additions and 1468 deletions

View file

@ -30,7 +30,6 @@ import (
"cloud.google.com/go/internal/trace"
"google.golang.org/api/googleapi"
storagepb "google.golang.org/genproto/googleapis/storage/v2"
"google.golang.org/protobuf/proto"
)
var crc32cTable = crc32.MakeTable(crc32.Castagnoli)
@ -475,7 +474,10 @@ func (o *ObjectHandle) newRangeReaderWithGRPC(ctx context.Context, offset, lengt
}
req.ReadOffset = start
setRequestConditions(req, o.conds)
if err := applyCondsProto("reopenWithGRPC", o.gen, o.conds, req); err != nil {
cancel()
return nil, nil, err
}
var stream storagepb.Storage_ReadObjectClient
var msg *storagepb.ReadObjectResponse
@ -631,10 +633,7 @@ func (r *Reader) readWithGRPC(p []byte) (int, error) {
if leftover > 0 {
// Wasn't able to copy all of the data in the message, store for
// future Read calls.
// TODO: Instead of acquiring a new block of memory, should we reuse
// the existing leftovers slice, expanding it if necessary?
r.leftovers = make([]byte, leftover)
copy(r.leftovers, content[n:])
r.leftovers = content[n:]
}
r.seen += int64(n)
@ -683,29 +682,6 @@ func (r *Reader) reopenStream(seen int64) (*storagepb.ReadObjectResponse, error)
return res.response, nil
}
// setRequestConditions is used to apply the given Conditions to a gRPC request
// message.
//
// This is an experimental API and not intended for public use.
func setRequestConditions(req *storagepb.ReadObjectRequest, conds *Conditions) {
if conds == nil {
return
}
if conds.MetagenerationMatch != 0 {
req.IfMetagenerationMatch = proto.Int64(conds.MetagenerationMatch)
} else if conds.MetagenerationNotMatch != 0 {
req.IfMetagenerationNotMatch = proto.Int64(conds.MetagenerationNotMatch)
}
switch {
case conds.GenerationNotMatch != 0:
req.IfGenerationNotMatch = proto.Int64(conds.GenerationNotMatch)
case conds.GenerationMatch != 0:
req.IfGenerationMatch = proto.Int64(conds.GenerationMatch)
case conds.DoesNotExist:
req.IfGenerationMatch = proto.Int64(0)
}
}
// Size returns the size of the object in bytes.
// The returned value is always the same and is not affected by
// calls to Read or Close.