Skip to content

Fix invalid config JSON and enforce canonical config format#1318

Open
hakman wants to merge 1 commit into
kubernetes:masterfrom
hakman:fix-config-json-trailing-commas
Open

Fix invalid config JSON and enforce canonical config format#1318
hakman wants to merge 1 commit into
kubernetes:masterfrom
hakman:fix-config-json-trailing-commas

Conversation

@hakman

@hakman hakman commented Jul 13, 2026

Copy link
Copy Markdown
Member

config/disk-log-message-filelog.json contained trailing commas and no trailing newline, so it could not be parsed by encoding/json and NPD would fail to start when configured with it.

This PR:

  • Fixes the invalid JSON.
  • Adds TestShippedConfigs, which verifies that every shipped config/*.json parses (catching trailing commas, UTF-8 BOMs and other syntax errors) and is in the canonical format (2-space indent, trailing newline), showing a diff on failure.
  • Adds make fmt-configs to rewrite nonconforming files in place (UPDATE_EXPECTED=y).
  • Normalizes the existing config files to the canonical format (whitespace-only changes).

@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 13, 2026
@kubernetes-prow
kubernetes-prow Bot requested a review from derekwaynecarr July 13, 2026 05:10
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot requested a review from klueska July 13, 2026 05:10
@kubernetes-prow kubernetes-prow Bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 13, 2026
@hakman
hakman force-pushed the fix-config-json-trailing-commas branch from cef4e2d to c297b25 Compare July 13, 2026 14:26
@kubernetes-prow kubernetes-prow Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 13, 2026
@hakman
hakman force-pushed the fix-config-json-trailing-commas branch from c297b25 to 7b2d3e7 Compare July 13, 2026 14:27
@hakman hakman changed the title Fix invalid JSON in disk-log-message-filelog.json Fix invalid JSON in disk-log-message-filelog.json and enforce config format Jul 13, 2026
@kubernetes-prow kubernetes-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 15, 2026
config/disk-log-message-filelog.json contained trailing commas and no
trailing newline, so it could not be parsed by encoding/json and NPD
would fail to start when configured with it.

- Fix the invalid JSON
- Add TestShippedConfigs, which verifies that every shipped config/*.json
  parses (catching trailing commas, UTF-8 BOMs and other syntax errors)
  and is in the canonical format (2-space indent, trailing newline),
  showing a diff on failure
- Add `make fmt-configs` to rewrite nonconforming files in place
  (UPDATE_EXPECTED=y)
- Normalize the existing config files to the canonical format
  (whitespace-only changes)
@hakman
hakman force-pushed the fix-config-json-trailing-commas branch from 7b2d3e7 to c96c103 Compare July 15, 2026 11:01
@kubernetes-prow kubernetes-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 15, 2026
@hakman hakman changed the title Fix invalid JSON in disk-log-message-filelog.json and enforce config format Fix invalid config JSON and enforce canonical config format Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant