Skip to content

Commit 608f1ab

Browse files
committed
remove from all target
Signed-off-by: Bogdan Stancu <[email protected]>
1 parent f97b319 commit 608f1ab

File tree

5 files changed

+7
-30
lines changed

5 files changed

+7
-30
lines changed

docs/configuration/config-file-reference.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,6 @@ query_scheduler:
412412
[connect_timeout: <duration> | default = 5s]
413413

414414
overrides:
415-
# Enable the overrides API module
416-
# CLI flag: -overrides.enabled
417-
[enabled: <boolean> | default = false]
418-
419415
# Path to the runtime configuration file that can be updated via the overrides
420416
# API
421417
# CLI flag: -overrides.runtime-config-file

integration/overrides_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ func TestOverridesAPIWithRunningCortex(t *testing.T) {
5656
flags := mergeFlags(
5757
baseFlags,
5858
map[string]string{
59-
"-target": "overrides",
60-
"-overrides.enabled": "true",
59+
"-target": "overrides",
60+
6161
"-overrides.runtime-config-file": "runtime.yaml",
6262
"-overrides.backend": "s3",
6363
"-overrides.s3.access-key-id": e2edb.MinioAccessKey,
@@ -224,8 +224,8 @@ func TestOverridesAPITenantExtraction(t *testing.T) {
224224
flags := mergeFlags(
225225
baseFlags,
226226
map[string]string{
227-
"-target": "overrides",
228-
"-overrides.enabled": "true",
227+
"-target": "overrides",
228+
229229
"-overrides.runtime-config-file": "runtime.yaml",
230230
"-overrides.backend": "s3",
231231
"-overrides.s3.access-key-id": e2edb.MinioAccessKey,
@@ -278,7 +278,6 @@ func TestOverridesAPIFilesystemBackendRejected(t *testing.T) {
278278
baseFlags,
279279
map[string]string{
280280
"-target": "overrides",
281-
"-overrides.enabled": "true",
282281
"-overrides.runtime-config-file": "runtime.yaml",
283282
"-overrides.backend": "filesystem",
284283
"-ring.store": "consul",
@@ -303,7 +302,6 @@ func TestOverridesAPIFilesystemBackendRejected(t *testing.T) {
303302
baseFlags,
304303
map[string]string{
305304
"-target": "overrides",
306-
"-overrides.enabled": "true",
307305
"-overrides.runtime-config-file": "runtime.yaml",
308306
"-ring.store": "consul",
309307
"-consul.hostname": "localhost:8500",

pkg/cortex/modules.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@ func (t *Cortex) initOverridesConfig() (services.Service, error) {
210210
}
211211

212212
func (t *Cortex) initOverrides() (services.Service, error) {
213-
if !t.Cfg.Overrides.Enabled {
214-
return nil, nil
215-
}
216213

217214
overridesAPI, err := overrides.New(t.Cfg.Overrides, util_log.Logger, prometheus.DefaultRegisterer)
218215
if err != nil {
@@ -932,7 +929,7 @@ func (t *Cortex) setupModuleManager() error {
932929
TenantDeletion: {API, OverridesConfig},
933930
Purger: {TenantDeletion},
934931
TenantFederation: {Queryable},
935-
All: {QueryFrontend, Querier, Ingester, Distributor, Purger, StoreGateway, Ruler, Compactor, AlertManager, Overrides},
932+
All: {QueryFrontend, Querier, Ingester, Distributor, Purger, StoreGateway, Ruler, Compactor, AlertManager},
936933
}
937934
if t.Cfg.ExternalPusher != nil && t.Cfg.ExternalQueryable != nil {
938935
deps[Ruler] = []string{OverridesConfig, RulerStorage}

pkg/overrides/overrides.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ const (
2828
// Config holds configuration for the overrides module
2929
type Config struct {
3030
// Enable the overrides API module
31-
// CLI flag: -overrides.enabled
32-
Enabled bool `yaml:"enabled"`
3331

3432
// Path to the runtime configuration file that can be updated via the overrides API
3533
// CLI flag: -overrides.runtime-config-file
@@ -42,17 +40,14 @@ type Config struct {
4240

4341
// RegisterFlags registers the overrides module flags
4442
func (c *Config) RegisterFlags(f *flag.FlagSet) {
45-
f.BoolVar(&c.Enabled, "overrides.enabled", false, "Enable the overrides API module")
43+
4644
f.StringVar(&c.RuntimeConfigFile, "overrides.runtime-config-file", "runtime.yaml", "Path to the runtime configuration file that can be updated via the overrides API")
4745

4846
c.RegisterFlagsWithPrefix("overrides.", f)
4947
}
5048

5149
// Validate validates the configuration and returns an error if validation fails
5250
func (c *Config) Validate() error {
53-
if !c.Enabled {
54-
return nil
55-
}
5651

5752
if c.RuntimeConfigFile == "" {
5853
c.RuntimeConfigFile = "runtime.yaml"

pkg/overrides/overrides_test.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ func TestConfig_Validate(t *testing.T) {
3232
},
3333
"disabled config should pass": {
3434
initConfig: func(cfg *Config) {
35-
cfg.Enabled = false
35+
3636
},
3737
expected: nil,
3838
},
3939
"enabled config should pass": {
4040
initConfig: func(cfg *Config) {
41-
cfg.Enabled = true
4241
cfg.Config = bucket.Config{
4342
Backend: bucket.S3,
4443
S3: s3.Config{
@@ -87,7 +86,6 @@ func TestNew(t *testing.T) {
8786
}{
8887
"valid config should create API": {
8988
cfg: Config{
90-
Enabled: true,
9189
Config: bucket.Config{
9290
Backend: bucket.S3,
9391
S3: s3.Config{
@@ -123,7 +121,6 @@ func TestNew(t *testing.T) {
123121
func TestOverridesModuleServiceInterface(t *testing.T) {
124122
// Create the API instance with proper configuration
125123
cfg := Config{
126-
Enabled: true,
127124
Config: bucket.Config{
128125
Backend: bucket.S3,
129126
S3: s3.Config{
@@ -298,8 +295,6 @@ hard_overrides:
298295

299296
// Create the API instance with proper configuration
300297
cfg := Config{
301-
Enabled: true,
302-
303298
Config: bucket.Config{
304299
Backend: bucket.S3,
305300
S3: s3.Config{
@@ -408,8 +403,6 @@ func TestAPITenantExtraction(t *testing.T) {
408403

409404
// Create the API instance with proper configuration
410405
cfg := Config{
411-
Enabled: true,
412-
413406
Config: bucket.Config{
414407
Backend: bucket.S3,
415408
S3: s3.Config{
@@ -501,8 +494,6 @@ func TestAPIBucketErrors(t *testing.T) {
501494

502495
// Create the API instance with proper configuration
503496
cfg := Config{
504-
Enabled: true,
505-
506497
Config: bucket.Config{
507498
Backend: bucket.S3,
508499
S3: s3.Config{

0 commit comments

Comments
 (0)