-
Notifications
You must be signed in to change notification settings - Fork 170
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
chore: enable rest plugin only if in config or if --rest-http-port is set #1593
Conversation
… passed Signed-off-by: Gabriele Baldoni <gabriele.baldoni@gmail.com>
PR missing one of the required labels: {'bug', 'breaking-change', 'enhancement', 'internal', 'documentation', 'dependencies', 'new feature'} |
Should be: // apply '--rest-http-port' to config only if explicitly set (overwriting config)
// or if no config file is set (to apply its default value)
if args.rest_http_port.is_some() || args.config.is_none() {
match args.rest_http_port.as_deref() {
Some(value) => {
if !value.eq_ignore_ascii_case("none") {
config
.insert_json5("plugins/rest/http_port", &format!(r#""{value}""#))
.unwrap();
config
.insert_json5("plugins/rest/__required__", "true")
.unwrap();
}
}
None => {
config
.insert_json5("plugins/rest/http_port", "8000")
.unwrap();
}
}
} |
shouldn't the |
Well the point is that we want rest to start on port 8000 by default if nothing is specified. |
the point of my PR is not not have it unless |
I believed the point of the PR was to not fail if rest was not available but still start it on port 8000 by default if available. |
I agree with this PR and not having unnecessary services running if not specified. |
Update: @gabrik this PR is complete from PoV. Anything else? |
Looks good to me, but I cannot approve as I commited here. |
We have examples of REST API usage in backends READMEs that shall be updated with the correct
|
Currently the rest plugin is enabled by default for
zenohd
, which means that its a required dependency when running a simple zenoh router without configuration.This PR changes the behaviour by enabling the rest plugin only if the
--rest-http-port
is passed.