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

admin: Add debug-addr CLI flag #7840

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

admin: Add debug-addr CLI flag #7840

wants to merge 6 commits into from

Conversation

jprenken
Copy link
Contributor

@jprenken jprenken commented Nov 22, 2024

If provided, the CLI flag will override the value in the config file.

Use the CLI flag to de-conflict parallel integration tests.

Make debug addresses optional for all cmds.

Fixes #7838

If provided, the CLI flag will override the value in the config file.

Use the CLI flag to de-conflict parallel integration tests.

Fixes #7838
@jprenken jprenken requested a review from a team as a code owner November 22, 2024 03:56
test/config-next/sfe.json Show resolved Hide resolved
@@ -92,6 +93,7 @@ func main() {
// they're present.
configFile := flag.String("config", "", "Path to the configuration file for this service (required)")
dryRun := flag.Bool("dry-run", true, "Print actions instead of mutating the database")
debugAddr := flag.String("debug-addr", "", "Debug server address override")
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're removing the need for debugAddr in newStatsRegistry, then I think there's no need to add this CLI flag here anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with this. And above, in admin.go lines 50-52.

os.Exit(1)
}
logger.Infof("Debug server listening on %s", addr)
logger.Infof("No debug server specified")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
logger.Infof("No debug server specified")
logger.Infof("No debug listen address specified")

The old "listen address" terminology is a little more correct. "No debug server specified" sounds like Boulder was expecting a remote server to talk to as opposed to a local address to listen on.

Also, even though we are getting rid the Exit(1), this is a good place to make use of the early return pattern: after the log statement, return registry(). Then the else can be removed and the following lines outdented.

Speaking of which, there's another refactoring opportunity at hand: We could move this check all the way up to the top of the function, immediately after prometheus.NewRegistry(). That makes it clear that when there's no debug port, the HTTP server is not even created.

@@ -92,6 +93,7 @@ func main() {
// they're present.
configFile := flag.String("config", "", "Path to the configuration file for this service (required)")
dryRun := flag.Bool("dry-run", true, "Print actions instead of mutating the database")
debugAddr := flag.String("debug-addr", "", "Debug server address override")
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with this. And above, in admin.go lines 50-52.

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.

Race between TestAdminClearEmail and TestIssuanceCertStorageFailed
4 participants