Skip to content

Commit 2eab3d7

Browse files
committed
Removed ruler config from integration tests. Allow single binary to start without a ruler config
Signed-off-by: Joe Elliott <[email protected]>
1 parent d0e1254 commit 2eab3d7

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

integration/e2ecortex/services.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,6 @@ func NewSingleBinary(name string, flags map[string]string, image string, otherPo
237237
"-ingester.concurrent-flushes": "10",
238238
"-ingester.max-transfer-retries": "10",
239239
"-ingester.num-tokens": "512",
240-
// Ruler
241-
"-ruler.storage.type": "local",
242-
"-ruler.storage.local.directory": "/tmp/cortex/rules",
243240
}, flags))...),
244241
e2e.NewHTTPReadinessProbe(httpPort, "/ready", 200, 299),
245242
httpPort,

pkg/cortex/modules.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,15 @@ func (t *Cortex) initTableManager() (services.Service, error) {
450450
}
451451

452452
func (t *Cortex) initRuler() (serv services.Service, err error) {
453+
// if the ruler is not configured and we're in single binary then let's just log an error and continue
454+
// unfortunately there is no way to generate a "default" config and compare default against actual
455+
// to determine if it's unconfigured. the following check, however, correctly tests this.
456+
// Single binary integration tests will break if this ever drifts
457+
if t.Cfg.Target == All && t.Cfg.Ruler.StoreConfig.Type == "configdb" && t.Cfg.Ruler.StoreConfig.ConfigDB.ConfigsAPIURL.URL == nil {
458+
level.Info(util.Logger).Log("msg", "Ruler is not configured in single binary mode and will not be started.")
459+
return nil, nil
460+
}
461+
453462
t.Cfg.Ruler.Ring.ListenPort = t.Cfg.Server.GRPCListenPort
454463
t.Cfg.Ruler.Ring.KVStore.MemberlistKV = t.MemberlistKV.GetMemberlistKV
455464
rulerRegisterer := prometheus.WrapRegistererWith(prometheus.Labels{"engine": "ruler"}, prometheus.DefaultRegisterer)

0 commit comments

Comments
 (0)