| 742 | } |
| 743 | |
| 744 | func (t *Cortex) initConfig() (serv services.Service, err error) { |
| 745 | t.ConfigDB, err = db.New(t.Cfg.Configs.DB) |
| 746 | if err != nil { |
| 747 | return |
| 748 | } |
| 749 | |
| 750 | t.Cfg.Configs.API.NameValidationScheme = t.Cfg.NameValidationScheme |
| 751 | t.ConfigAPI = configAPI.New(t.ConfigDB, t.Cfg.Configs.API) |
| 752 | t.ConfigAPI.RegisterRoutes(t.Server.HTTP) |
| 753 | return services.NewIdleService(nil, func(_ error) error { |
| 754 | t.ConfigDB.Close() |
| 755 | return nil |
| 756 | }), nil |
| 757 | } |
| 758 | |
| 759 | func (t *Cortex) initAlertManager() (serv services.Service, err error) { |
| 760 | t.Cfg.Alertmanager.ShardingRing.ListenPort = t.Cfg.Server.GRPCListenPort |