segments: send in the object path to the initial CreateSegment… (#2518)

otherwise, api key restictions will fail because we look like we're
asking to put to the bucket metadata path.
This commit is contained in:
Jeff Wendling 2019-07-10 11:33:55 -04:00 committed by GitHub
parent 7886a4d7b9
commit 10547cc1ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,13 +128,13 @@ func (s *segmentStore) Put(ctx context.Context, data io.Reader, expiration time.
if err != nil {
return Meta{}, Error.Wrap(err)
}
bucket, _, _, err := splitPathFragments(p)
bucket, objectPath, _, err := splitPathFragments(p)
if err != nil {
return Meta{}, err
}
// path and segment index are not known at this point
limits, rootPieceID, err := s.metainfo.CreateSegment(ctx, bucket, "", -1, redundancy, s.maxEncryptedSegmentSize, expiration)
limits, rootPieceID, err := s.metainfo.CreateSegment(ctx, bucket, objectPath, -1, redundancy, s.maxEncryptedSegmentSize, expiration)
if err != nil {
return Meta{}, Error.Wrap(err)
}