Skip to content

Commit 3df0287

Browse files
authored
feat(storage): support MatchGlob for gRPC (#8670)
Updates #7727
1 parent d21429e commit 3df0287

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

storage/grpc_client.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -408,17 +408,13 @@ func (c *grpcStorageClient) ListObjects(ctx context.Context, bucket string, q *Q
408408
LexicographicStart: it.query.StartOffset,
409409
LexicographicEnd: it.query.EndOffset,
410410
IncludeTrailingDelimiter: it.query.IncludeTrailingDelimiter,
411+
MatchGlob: it.query.MatchGlob,
411412
ReadMask: q.toFieldMask(), // a nil Query still results in a "*" FieldMask
412413
}
413414
if s.userProject != "" {
414415
ctx = setUserProjectMetadata(ctx, s.userProject)
415416
}
416417
fetch := func(pageSize int, pageToken string) (token string, err error) {
417-
// MatchGlob not yet supported for gRPC.
418-
// TODO: add support when b/287306063 resolved.
419-
if q != nil && q.MatchGlob != "" {
420-
return "", status.Errorf(codes.Unimplemented, "MatchGlob is not supported for gRPC")
421-
}
422418
var objects []*storagepb.Object
423419
var gitr *gapic.ObjectIterator
424420
err = run(it.ctx, func(ctx context.Context) error {

storage/integration_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1294,8 +1294,7 @@ func TestIntegration_ObjectIteration(t *testing.T) {
12941294
func TestIntegration_ObjectIterationMatchGlob(t *testing.T) {
12951295
// This is a separate test from the Object Iteration test above because
12961296
// MatchGlob is not yet implemented for gRPC.
1297-
ctx := skipGRPC("https://github.com/googleapis/google-cloud-go/issues/7727")
1298-
multiTransportTest(skipJSONReads(ctx, "no reads in test"), t, func(t *testing.T, ctx context.Context, _ string, prefix string, client *Client) {
1297+
multiTransportTest(skipJSONReads(context.Background(), "no reads in test"), t, func(t *testing.T, ctx context.Context, _ string, prefix string, client *Client) {
12991298
// Reset testTime, 'cause object last modification time should be within 5 min
13001299
// from test (test iteration if -count passed) start time.
13011300
testTime = time.Now().UTC()

0 commit comments

Comments
 (0)