-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
base: main
Are you sure you want to change the base?
Conversation
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
@@ -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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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") |
There was a problem hiding this comment.
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.
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