Skip to content

Commit

Permalink
Changing iterator retrieval logic
Browse files Browse the repository at this point in the history
  • Loading branch information
michael.szacillo committed Dec 10, 2020
1 parent 5f9dce1 commit d8427f4
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pkg/agent/storage/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ type GCSObjectDownloader struct {
}

func (g *GCSObjectDownloader) GetObjectIterator(client stiface.Client) (stiface.ObjectIterator, error) {
// If object field is nonempty, we should find the specified object and fail-fast if it doesn't exist.
// Otherwise iterate through bucket
if g.Item != "" {
_, err := client.Bucket(g.Bucket).Object(g.Item).Attrs(g.Context)
if err != nil {
return nil, err
}
}
query := &gstorage.Query{Prefix: g.Item}
return client.Bucket(g.Bucket).Objects(g.Context, query), nil
}
Expand Down Expand Up @@ -129,5 +121,6 @@ func (g *GCSObjectDownloader) WriteToFile(data []byte, attrs *gstorage.ObjectAtt
err,
)
}
log.Info("Wrote " + attrs.Prefix + " to file " + file.Name())
return nil
}

0 comments on commit d8427f4

Please sign in to comment.