diff --git a/service/internal/config/config.go b/service/internal/config/config.go index f3cb3ea118..f77fab6bc0 100644 --- a/service/internal/config/config.go +++ b/service/internal/config/config.go @@ -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 } diff --git a/service/pkg/server/start.go b/service/pkg/server/start.go index 971cbc0eb7..1c3ce0fd80 100644 --- a/service/pkg/server/start.go +++ b/service/pkg/server/start.go @@ -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 { diff --git a/service/pkg/serviceregistry/serviceregistry.go b/service/pkg/serviceregistry/serviceregistry.go index 25ce13b1d0..b81793154a 100644 --- a/service/pkg/serviceregistry/serviceregistry.go +++ b/service/pkg/serviceregistry/serviceregistry.go @@ -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 {