Skip to content

Commit

Permalink
remove unused home provider from config (#2428)
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic authored Jan 10, 2022
1 parent c05e074 commit 17ea34e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/remove-unused-home-provider-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: remove unused home provider from config

The spaces registry does not use a home provider config.

https://github.com/cs3org/reva/pull/2428
13 changes: 1 addition & 12 deletions pkg/storage/registry/spaces/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,11 @@ type StorageProviderClient interface {
}

type config struct {
Providers map[string]*Provider `mapstructure:"providers"`
HomeTemplate string `mapstructure:"home_template"`
Providers map[string]*Provider `mapstructure:"providers"`
}

func (c *config) init() {

if c.HomeTemplate == "" {
c.HomeTemplate = "/"
}

if len(c.Providers) == 0 {
c.Providers = map[string]*Provider{
sharedconf.GetGatewaySVC(""): {
Expand Down Expand Up @@ -165,10 +160,6 @@ func New(m map[string]interface{}, getClientFunc GetStorageProviderServiceClient
resourceNameCache: make(map[string]string),
getStorageProviderServiceClient: getClientFunc,
}
r.homeTemplate, err = template.New("home_template").Funcs(sprig.TxtFuncMap()).Parse(c.HomeTemplate)
if err != nil {
return nil, err
}
return r, nil
}

Expand All @@ -186,8 +177,6 @@ type GetStorageProviderServiceClientFunc func(addr string) (StorageProviderClien

type registry struct {
c *config
// the template to use when determining the home provider
homeTemplate *template.Template
// a map of resources to providers
resources map[string][]*registrypb.ProviderInfo
resourceNameCache map[string]string
Expand Down

0 comments on commit 17ea34e

Please sign in to comment.