Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions service/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,5 @@ func LoadConfig(key string) (*Config, error) {
return nil, errors.Join(err, ErrLoadingConfig)
}

// Manually handle unmarshaling of ExtraProps for each service
for serviceKey, service := range config.Services {
var extraProps map[string]interface{}
if err := viper.UnmarshalKey("service."+serviceKey, &extraProps); err != nil {
return nil, errors.Join(err, ErrLoadingConfig)
}
service.ExtraProps = extraProps

// Remove "enabled" from ExtraProps
delete(extraProps, "enabled")

config.Services[serviceKey] = service // Update the service in the map
}

return config, nil
}
2 changes: 2 additions & 0 deletions service/pkg/server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ func Start(f ...StartOptions) error {
}
slog.SetDefault(logger.Logger)

slog.Debug("config loaded", slog.Any("config", conf))

slog.Info("starting opa engine")
eng, err := opa.NewEngine(conf.OPA)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion service/pkg/serviceregistry/serviceregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
type ServiceConfig struct {
Enabled bool `yaml:"enabled"`
Remote RemoteServiceConfig `yaml:"remote"`
ExtraProps map[string]interface{} `json:"-"`
ExtraProps map[string]interface{} `json:"-" mapstructure:",remain"`
}

type RemoteServiceConfig struct {
Expand Down