Skip to content

Commit

Permalink
miniogw: remove PutObjectMetadata object lock shim
Browse files Browse the repository at this point in the history
Change-Id: I86eb91a8a266c5b56fd8f06f49d4ebe5df997a51
  • Loading branch information
halkyon committed Nov 21, 2024
1 parent 0900cd8 commit dbcccfa
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions pkg/server/gw/multi_tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,27 +657,6 @@ func (l *MultiTenancyLayer) DeleteObjectTags(ctx context.Context, bucketName, ob
return objInfo, l.log(ctx, err)
}

// PutObjectMetadata updates user-defined metadata on the given object.
//
// This is only called by PutObjectRetentionHandler in minio, currently.
//
// minio will not call this unless STORJ_MINIO_LOCK_ENABLED has been configured and set to true.
// STORJ_MINIO_LOCK_ENABLED will enable a shim form of object lock until we fully implement it.
//
// TODO(sean): replace this with calls to uplink when we have the functionality available.
func (l *MultiTenancyLayer) PutObjectMetadata(ctx context.Context, bucket, object string, opts minio.ObjectOptions) (minio.ObjectInfo, error) {
project, err := l.openProject(ctx, getAccessGrant(ctx))
if err != nil {
return minio.ObjectInfo{}, err
}

defer func() { err = errs.Combine(err, project.Close()) }()

objInfo, err := l.layer.PutObjectMetadata(miniogw.WithUplinkProject(ctx, project), bucket, object, opts)

return objInfo, l.log(ctx, err)
}

func getAccessGrant(ctx context.Context) string {
credentials := middleware.GetAccess(ctx)
if credentials == nil || credentials.AccessKey == "" {
Expand Down

0 comments on commit dbcccfa

Please sign in to comment.