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>

@friedrichg friedrichg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!. LGTM

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 9, 2026
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 lgtm This PR has been approved by a maintainer 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

2 participants