You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Config validation failure when setting flusher.exit_after_flush=false #5488
Describe the bug
If the following is set in the Cortex config file:
flusher:
exit_after_flush: false
validation will fail with the following error:
error validating config: the Flusher configuration in YAML has been specified as an empty YAML node
due to the fact that setting exit_after_flush to false results in the flusher config becoming equivalent to an empty struct with all zero-valued fields.
To Reproduce
Minimal unit test to reproduce the error:
diff --git a/cmd/cortex/main_test.go b/cmd/cortex/main_test.go
index 5c7194912..67ebb4493 100644
--- a/cmd/cortex/main_test.go+++ b/cmd/cortex/main_test.go@@ -79,6 +79,11 @@ func TestFlagParsing(t *testing.T) {
stderrMessage: "the Querier configuration in YAML has been specified as an empty YAML node",
},
+ "root level configuration option specified with all zero values": {+ yaml: "flusher: { exit_after_flush: false }",+ stderrExcluded: "empty YAML node",+ },+
"version": {
arguments: []string{"-version"},
stdoutMessage: "Cortex, version",
Expected behavior
The validation rule should probably check if the actual yaml node is empty. I think this can be done with yaml/v3.
This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.
Activity
stale commentedon Apr 26, 2025
This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.