Skip to content

Fix empty YAML validation for explicit zero values#7700

Open
Rohithmatham12 wants to merge 2 commits into
cortexproject:masterfrom
Rohithmatham12:fix-flusher-empty-yaml-validation
Open

Fix empty YAML validation for explicit zero values#7700
Rohithmatham12 wants to merge 2 commits into
cortexproject:masterfrom
Rohithmatham12:fix-flusher-empty-yaml-validation

Conversation

@Rohithmatham12

Copy link
Copy Markdown

What this changes

  • Records whether root-level YAML config keys are empty before strict unmarshalling.
  • Keeps the existing empty-root-node guard for cases like querier: and querier: {}.
  • Allows explicit zero values inside a non-empty root config, such as flusher: { exit_after_flush: false }.
  • Adds a startup config parsing regression test for the reported flusher case.

Fixes #5488.

Testing

  • GOCACHE=/private/tmp/cortex-go-cache GOMODCACHE=/private/tmp/cortex-go-mod-cache go test ./cmd/cortex

Signed-off-by: Rohithmatham12 <rohithmatham@gmail.com>
@dosubot dosubot Bot added go Pull requests that update Go code type/bug type/tests labels Jul 18, 2026
Signed-off-by: Rohithmatham12 <rohithmatham@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code size/M type/bug type/tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config validation failure when setting flusher.exit_after_flush=false

1 participant