Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
Signed-off-by: Yuvraj <[email protected]>
  • Loading branch information
yindia committed Aug 13, 2021
1 parent d005197 commit 3ac2955
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
2 changes: 2 additions & 0 deletions cli/pflags/api/testdata/testtype.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions cli/pflags/api/testdata/testtype_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion storage/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var (
type Config struct {
Type Type `json:"type" pflag:",Sets the type of storage to configure [s3/minio/local/mem/stow]."`
Connection ConnectionConfig `json:"connection"`
Stow *StowConfig `json:"stow,omitempty" pflag:",Storage config for stow backend."`
Stow StowConfig `json:"stow,omitempty" pflag:",Storage config for stow backend."`
// Container here is misleading, it refers to a Bucket (AWS S3) like blobstore entity. In some terms it could be a table
InitContainer string `json:"container" pflag:",Initial container (in s3 a bucket) to create -if it doesn't exist-.'"`
// By default if this is not enabled, multiple containers are not supported by the storage layer. Only the configured `container` InitContainer will be allowed to requests data from. But, if enabled then data will be loaded to written to any
Expand Down
3 changes: 2 additions & 1 deletion storage/stow_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"io"
"reflect"
"sync"
"time"

Expand Down Expand Up @@ -319,7 +320,7 @@ func newStowRawStore(cfg *Config, metricsScope promutils.Scope) (RawStore, error

var cfgMap stow.ConfigMap
var kind string
if cfg.Stow != nil {
if !reflect.DeepEqual(cfg.Stow, StowConfig{}) {
kind = cfg.Stow.Kind
cfgMap = cfg.Stow.Config
} else {
Expand Down
10 changes: 5 additions & 5 deletions storage/stow_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func TestNewLocalStore(t *testing.T) {
t.Run("Valid config", func(t *testing.T) {
testScope := promutils.NewTestScope()
store, err := newStowRawStore(&Config{
Stow: &StowConfig{
Stow: StowConfig{
Kind: local.Kind,
Config: map[string]string{
local.ConfigKeyPath: "./",
Expand Down Expand Up @@ -339,7 +339,7 @@ func TestNewLocalStore(t *testing.T) {
assert.NotNil(t, stats)

store, err := newStowRawStore(&Config{
Stow: &StowConfig{
Stow: StowConfig{
Kind: local.Kind,
Config: map[string]string{
local.ConfigKeyPath: tmpDir,
Expand Down Expand Up @@ -368,7 +368,7 @@ func TestNewLocalStore(t *testing.T) {
assert.NotNil(t, stats)

store, err := newStowRawStore(&Config{
Stow: &StowConfig{
Stow: StowConfig{
Kind: local.Kind,
Config: map[string]string{
local.ConfigKeyPath: tmpDir,
Expand All @@ -390,7 +390,7 @@ func TestNewLocalStore(t *testing.T) {
assert.NotNil(t, stats)

store, err := newStowRawStore(&Config{
Stow: &StowConfig{
Stow: StowConfig{
Kind: local.Kind,
Config: map[string]string{
local.ConfigKeyPath: tmpDir,
Expand Down Expand Up @@ -424,7 +424,7 @@ func Test_newStowRawStore(t *testing.T) {
{"fail", args{&Config{}, promutils.NewTestScope()}, true},
{"google", args{&Config{
InitContainer: "flyte",
Stow: &StowConfig{
Stow: StowConfig{
Kind: google.Kind,
Config: map[string]string{
google.ConfigProjectId: "x",
Expand Down

0 comments on commit 3ac2955

Please sign in to comment.