Skip to content

Commit

Permalink
Configure the nats service for the system storage extension
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed May 18, 2022
1 parent dbe04e6 commit 0b56e02
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
10 changes: 8 additions & 2 deletions extensions/storage-system/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ type Config struct {
Log *Log `yaml:"log"`
Debug Debug `yaml:"debug"`

GRPC GRPCConfig `yaml:"grpc"`
HTTP HTTPConfig `yaml:"http"`
GRPC GRPCConfig `yaml:"grpc"`
HTTP HTTPConfig `yaml:"http"`
Events Events `yaml:"events"`

TokenManager *TokenManager `yaml:"token_manager"`
Reva *Reva `yaml:"reva"`
Expand Down Expand Up @@ -77,3 +78,8 @@ type OCISDriver struct {
// Root is the absolute path to the location of the data
Root string `yaml:"root" env:"STORAGE_SYSTEM_OCIS_ROOT"`
}

type Events struct {
Addr string `yaml:"endpoint" env:"STORAGE_SYSTEM_EVENTS_ENDPOINT" desc:"the address of the streaming service"`
ClusterID string `yaml:"cluster" env:"STORAGE_SYSTEM_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"`
}
14 changes: 8 additions & 6 deletions extensions/storage-users/pkg/revaconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ func StorageUsersConfigFromStruct(cfg *config.Config) map[string]interface{} {
// TODO build services dynamically
"services": map[string]interface{}{
"dataprovider": map[string]interface{}{
"prefix": cfg.HTTP.Prefix,
"driver": cfg.Driver,
"drivers": UserDrivers(cfg),
"timeout": 86400,
"insecure": cfg.DataProviderInsecure,
"disable_tus": false,
"prefix": cfg.HTTP.Prefix,
"driver": cfg.Driver,
"drivers": UserDrivers(cfg),
"timeout": 86400,
"insecure": cfg.DataProviderInsecure,
"disable_tus": false,
"nats_address": cfg.Events.Addr,
"nats_clusterID": cfg.Events.ClusterID,
},
},
},
Expand Down

0 comments on commit 0b56e02

Please sign in to comment.