Skip to content

Commit

Permalink
Remove storageID from BlockstoreMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
itaigilo committed Jan 29, 2025
1 parent 9be4765 commit 82e261d
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pkg/block/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ type Adapter interface {
CompleteMultiPartUpload(ctx context.Context, obj ObjectPointer, uploadID string, multipartList *MultipartUploadCompletion) (*CompleteMultiPartUploadResponse, error)

BlockstoreType() string
BlockstoreMetadata(ctx context.Context, storageID string) (*BlockstoreMetadata, error)
BlockstoreMetadata(ctx context.Context) (*BlockstoreMetadata, error)
GetStorageNamespaceInfo(storageID string) (StorageNamespaceInfo, error)
ResolveNamespace(storageID, storageNamespace, key string, identifierType IdentifierType) (QualifiedKey, error)

Expand Down
2 changes: 1 addition & 1 deletion pkg/block/azure/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ func (a *Adapter) BlockstoreType() string {
return block.BlockstoreTypeAzure
}

func (a *Adapter) BlockstoreMetadata(_ context.Context, _ string) (*block.BlockstoreMetadata, error) {
func (a *Adapter) BlockstoreMetadata(_ context.Context) (*block.BlockstoreMetadata, error) {
return nil, block.ErrOperationNotSupported
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/block/gs/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ func (a *Adapter) BlockstoreType() string {
return block.BlockstoreTypeGS
}

func (a *Adapter) BlockstoreMetadata(_ context.Context, _ string) (*block.BlockstoreMetadata, error) {
func (a *Adapter) BlockstoreMetadata(_ context.Context) (*block.BlockstoreMetadata, error) {
return nil, block.ErrOperationNotSupported
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/block/local/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ func (l *Adapter) BlockstoreType() string {
return block.BlockstoreTypeLocal
}

func (l *Adapter) BlockstoreMetadata(_ context.Context, _ string) (*block.BlockstoreMetadata, error) {
func (l *Adapter) BlockstoreMetadata(_ context.Context) (*block.BlockstoreMetadata, error) {
return nil, block.ErrOperationNotSupported
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/block/mem/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func (a *Adapter) BlockstoreType() string {
return block.BlockstoreTypeMem
}

func (a *Adapter) BlockstoreMetadata(_ context.Context, _ string) (*block.BlockstoreMetadata, error) {
func (a *Adapter) BlockstoreMetadata(_ context.Context) (*block.BlockstoreMetadata, error) {
return nil, block.ErrOperationNotSupported
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/block/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ func (m *MetricsAdapter) BlockstoreType() string {
return m.adapter.BlockstoreType()
}

func (m *MetricsAdapter) BlockstoreMetadata(ctx context.Context, storageID string) (*BlockstoreMetadata, error) {
func (m *MetricsAdapter) BlockstoreMetadata(ctx context.Context) (*BlockstoreMetadata, error) {
ctx = httputil.SetClientTrace(ctx, m.adapter.BlockstoreType())
return m.adapter.BlockstoreMetadata(ctx, storageID)
return m.adapter.BlockstoreMetadata(ctx)
}

func (m *MetricsAdapter) GetStorageNamespaceInfo(storageID string) (StorageNamespaceInfo, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/block/s3/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ func (a *Adapter) BlockstoreType() string {
return block.BlockstoreTypeS3
}

func (a *Adapter) BlockstoreMetadata(ctx context.Context, _ string) (*block.BlockstoreMetadata, error) {
func (a *Adapter) BlockstoreMetadata(ctx context.Context) (*block.BlockstoreMetadata, error) {
region, err := a.clients.GetBucketRegionDefault(ctx, "")
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/block/transient/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (a *Adapter) BlockstoreType() string {
return block.BlockstoreTypeTransient
}

func (a *Adapter) BlockstoreMetadata(_ context.Context, _ string) (*block.BlockstoreMetadata, error) {
func (a *Adapter) BlockstoreMetadata(_ context.Context) (*block.BlockstoreMetadata, error) {
return nil, block.ErrOperationNotSupported
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/block/validations.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func ValidateInterRegionStorage(ctx context.Context, adapter Adapter, storageID, storageNamespace string) error {
blockstoreMetadata, err := adapter.BlockstoreMetadata(ctx, storageID)
blockstoreMetadata, err := adapter.BlockstoreMetadata(ctx)
if errors.Is(err, ErrOperationNotSupported) {
// region detection not supported for the server's blockstore, skip validation
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/testutil/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (a *MockAdapter) BlockstoreType() string {
return "s3"
}

func (a *MockAdapter) BlockstoreMetadata(_ context.Context, _ string) (*block.BlockstoreMetadata, error) {
func (a *MockAdapter) BlockstoreMetadata(_ context.Context) (*block.BlockstoreMetadata, error) {
if a.blockstoreMetadata != nil {
return a.blockstoreMetadata, nil
} else {
Expand Down

0 comments on commit 82e261d

Please sign in to comment.