Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: allow empty configs, but prevent bad configs #4394

Merged
merged 2 commits into from Aug 15, 2023
Merged

Conversation

wallyqs
Copy link
Member

@wallyqs wallyqs commented Aug 14, 2023

Allows again empty configs and improves support for detecting some types of invalid configs:

  • Adds reporting the line with the bad key position that makes the config invalid.
nats-server: config is invalid (foo.conf:1:2)
nats-server: error parsing include file 'included.conf', config is invalid (included.conf:2:2)
  • Fixes a few tests with trailing braces which were being handled as keys and ignored before.

@wallyqs wallyqs requested a review from a team as a code owner August 14, 2023 05:27
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

Should we target main vs dev?

- Adds reporting the line with the bad key position
  that makes the config invalid.

- Fixes a few tests with trailing braces which were
  being handled as keys and ignored before.

Signed-off-by: Waldemar Quevedo <wally@nats.io>
@wallyqs wallyqs changed the base branch from dev to main August 14, 2023 06:14
Signed-off-by: Waldemar Quevedo <wally@nats.io>
@wallyqs
Copy link
Member Author

wallyqs commented Aug 14, 2023

changed branch to main and added a check to report loading empty configs as a warning only

Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

@wallyqs wallyqs merged commit 1e87c3d into main Aug 15, 2023
2 checks passed
@wallyqs wallyqs deleted the empty-conf-ok branch August 15, 2023 13:11
wallyqs added a commit that referenced this pull request Aug 22, 2023
Fixes a side effect from #4394 which was breaking support for JSON
configs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants