mirror of
https://github.com/minio/minio.git
synced 2025-04-05 12:20:34 -04:00
allow lookup()/head() operations on Veeam SOS objects (#17331)
This commit is contained in:
parent
f86b9abf32
commit
54e544e03e
@ -442,6 +442,14 @@ func (er erasureObjects) getObjectWithFileInfo(ctx context.Context, bucket, obje
|
|||||||
func (er erasureObjects) GetObjectInfo(ctx context.Context, bucket, object string, opts ObjectOptions) (info ObjectInfo, err error) {
|
func (er erasureObjects) GetObjectInfo(ctx context.Context, bucket, object string, opts ObjectOptions) (info ObjectInfo, err error) {
|
||||||
auditObjectErasureSet(ctx, object, &er)
|
auditObjectErasureSet(ctx, object, &er)
|
||||||
|
|
||||||
|
// This is a special call attempted first to check for SOS-API calls.
|
||||||
|
info, err = veeamSOSAPIHeadObject(ctx, bucket, object, opts)
|
||||||
|
if err == nil {
|
||||||
|
return info, nil
|
||||||
|
}
|
||||||
|
// reset any error to 'nil'
|
||||||
|
err = nil
|
||||||
|
|
||||||
if !opts.NoLock {
|
if !opts.NoLock {
|
||||||
// Lock the object before reading.
|
// Lock the object before reading.
|
||||||
lk := er.NewNSLock(bucket, object)
|
lk := er.NewNSLock(bucket, object)
|
||||||
|
@ -115,6 +115,15 @@ const (
|
|||||||
capacityXMLObject = ".system-d26a9498-cb7c-4a87-a44a-8ae204f5ba6c/capacity.xml"
|
capacityXMLObject = ".system-d26a9498-cb7c-4a87-a44a-8ae204f5ba6c/capacity.xml"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func veeamSOSAPIHeadObject(ctx context.Context, bucket, object string, opts ObjectOptions) (ObjectInfo, error) {
|
||||||
|
gr, err := veeamSOSAPIGetObject(ctx, bucket, object, nil, opts)
|
||||||
|
if gr != nil {
|
||||||
|
gr.Close()
|
||||||
|
return gr.ObjInfo, nil
|
||||||
|
}
|
||||||
|
return ObjectInfo{}, err
|
||||||
|
}
|
||||||
|
|
||||||
func veeamSOSAPIGetObject(ctx context.Context, bucket, object string, rs *HTTPRangeSpec, opts ObjectOptions) (gr *GetObjectReader, err error) {
|
func veeamSOSAPIGetObject(ctx context.Context, bucket, object string, rs *HTTPRangeSpec, opts ObjectOptions) (gr *GetObjectReader, err error) {
|
||||||
var buf []byte
|
var buf []byte
|
||||||
switch object {
|
switch object {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user