Skip to content

amtool: fix panic if --verbose is in used. #4218

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

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

jkroepke
Copy link
Member

@jkroepke jkroepke commented Jan 23, 2025

fixes #4216

I pattern to test a command which invokes os.exit comes from https://willsena.dev/golang-how-to-test-code-that-exits-or-crashes/

@jkroepke jkroepke force-pushed the amtool branch 2 times, most recently from a2accb0 to b81f9dd Compare January 23, 2025 11:33
@grobinson-grafana
Copy link
Collaborator

Thanks for creating a fix for this! I appreciate that you have taken the time to add a test here, and I love it when contributors add tests, but I think in this specific case the test is not required. I would accept a PR with just promslogConfig.Level = &promslog.AllowedLevel{} as the diff here.

Verified

This commit was signed with the committer’s verified signature.
jkroepke Jan-Otto Kröpke
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
@grobinson-grafana grobinson-grafana merged commit 4462331 into prometheus:main Mar 7, 2025
11 checks passed
This was referenced Mar 7, 2025
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.

panic with amtool: invalid memory address or nil pointer dereference
2 participants