Skip to content

Commit

Permalink
CR Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
N-o-Z committed Feb 3, 2025
1 parent e3afbe0 commit 218664c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/lakefs/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ var runCmd = &cobra.Command{
bufferedCollector.CollectMetadata(metadata)

c, err := catalog.New(ctx, catalog.Config{
Config: baseCfg,
Config: cfg,
KVStore: kvStore,
PathProvider: upload.DefaultPathProvider,
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,7 @@ func (c *Controller) getStorageConfigList() apigen.StorageConfigList {
c.Logger.WithError(err).Error("no storage config found for id: %s", id)
continue
}

info.BlockstoreId = swag.String(id)
configList = append(configList, *info)
}
return configList
Expand Down
3 changes: 2 additions & 1 deletion pkg/block/azure/adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/treeverse/lakefs/pkg/block/azure"
"github.com/treeverse/lakefs/pkg/block/blocktest"
"github.com/treeverse/lakefs/pkg/block/params"
"github.com/treeverse/lakefs/pkg/config"
)

func TestAzureAdapter(t *testing.T) {
Expand Down Expand Up @@ -135,7 +136,7 @@ func TestAdapterNamespace(t *testing.T) {
}
require.NoError(t, err, "create new adapter")

namespaceInfo := adapter.GetStorageNamespaceInfo("")
namespaceInfo := adapter.GetStorageNamespaceInfo(config.SingleBlockstoreID)
expr, err := regexp.Compile(namespaceInfo.ValidityRegex)
require.NoError(t, err)

Expand Down
3 changes: 2 additions & 1 deletion pkg/block/gs/adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/treeverse/lakefs/pkg/block/blocktest"
"github.com/treeverse/lakefs/pkg/block/gs"
"github.com/treeverse/lakefs/pkg/config"
)

func newAdapter() *gs.Adapter {
Expand Down Expand Up @@ -36,7 +37,7 @@ func TestAdapterNamespace(t *testing.T) {
require.NoError(t, adapter.Close())
}()

expr, err := regexp.Compile(adapter.GetStorageNamespaceInfo("").ValidityRegex)
expr, err := regexp.Compile(adapter.GetStorageNamespaceInfo(config.SingleBlockstoreID).ValidityRegex)
require.NoError(t, err)

tests := []struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/block/local/adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/treeverse/lakefs/pkg/block"
"github.com/treeverse/lakefs/pkg/block/blocktest"
"github.com/treeverse/lakefs/pkg/block/local"
"github.com/treeverse/lakefs/pkg/config"
)

const testStorageNamespace = "local://test"
Expand All @@ -31,7 +32,7 @@ func TestAdapterNamespace(t *testing.T) {
localPath := path.Join(tmpDir, "lakefs")
adapter, err := local.NewAdapter(localPath, local.WithRemoveEmptyDir(false))
require.NoError(t, err, "create new adapter")
expr, err := regexp.Compile(adapter.GetStorageNamespaceInfo("").ValidityRegex)
expr, err := regexp.Compile(adapter.GetStorageNamespaceInfo(config.SingleBlockstoreID).ValidityRegex)
require.NoError(t, err)

tests := []struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/block/s3/adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/treeverse/lakefs/pkg/block/blocktest"
"github.com/treeverse/lakefs/pkg/block/params"
s3a "github.com/treeverse/lakefs/pkg/block/s3"
"github.com/treeverse/lakefs/pkg/config"
)

func getS3BlockAdapter(t *testing.T, opts []s3a.AdapterOption) *s3a.Adapter {
Expand Down Expand Up @@ -66,7 +67,7 @@ func TestS3AdapterPresignedOverride(t *testing.T) {
// TestAdapterNamespace tests the namespace validity regex with various paths
func TestAdapterNamespace(t *testing.T) {
adapter := getS3BlockAdapter(t, nil)
expr, err := regexp.Compile(adapter.GetStorageNamespaceInfo("").ValidityRegex)
expr, err := regexp.Compile(adapter.GetStorageNamespaceInfo(config.SingleBlockstoreID).ValidityRegex)
require.NoError(t, err)

tests := []struct {
Expand Down
9 changes: 5 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
UseLocalConfiguration = "local-settings"
QuickstartConfiguration = "quickstart"

// SingleBlockstoreID - Represents a single blockstore system
SingleBlockstoreID = ""
)

Expand Down Expand Up @@ -226,6 +227,10 @@ type Blockstore struct {
} `mapstructure:"gs"`
}

func (b *Blockstore) GetStorageIDs() []string {
return nil
}

func (b *Blockstore) GetStorageByID(id string) AdapterConfig {
if id != "" {
return nil
Expand Down Expand Up @@ -344,10 +349,6 @@ func (b *Blockstore) BlockstoreDescription() string {
return ""
}

func (b *Blockstore) GetStorageIDs() []string {
return nil
}

func (b *Blockstore) BlockstoreExtras() map[string]string {
return nil
}
Expand Down

0 comments on commit 218664c

Please sign in to comment.