admin: make admin HTML a compile-time option#21814
Conversation
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
| EXPECT_THAT(response->body(), HasSubstr("admin commands are:")); | ||
|
|
||
| EXPECT_EQ("200", request("admin", "GET", "/", response)); | ||
| #ifdef ENVOY_ADMIN_HTML |
There was a problem hiding this comment.
note: in other cases I did not need a -D for this, but it seemed painful to tweak this particular test without it.
I have this gut feel that this define is costly from a build perspective since it is passed on every compile-command, even though it's needed only by one test.
LMK if you think I should re-work this somehow.
| @@ -0,0 +1,122 @@ | |||
| #include "source/common/html/utility.h" | |||
There was a problem hiding this comment.
note to reviewers: this code is unchanged; just moved.
| namespace Envoy { | ||
| namespace Server { | ||
|
|
||
| Http::Code AdminImpl::handlerAdminHome(absl::string_view, Http::ResponseHeaderMap& response_headers, |
There was a problem hiding this comment.
this block here is the only new code in the PR.
mattklein123
left a comment
There was a problem hiding this comment.
Thanks LGTM with a small comment. Thank you!
/wait
| config_setting( | ||
| name = "disable_admin_html", | ||
| values = {"define": "admin_html=disabled"}, | ||
| ) | ||
|
|
There was a problem hiding this comment.
Can you document this here? https://github.com/envoyproxy/envoy/tree/main/bazel#disabling-optional-features
Probably also worth a release note?
Signed-off-by: Joshua Marantz <jmarantz@google.com>
|
/retest |
|
Retrying Azure Pipelines: |
|
Thanks Matt! |
Commit Message: Make the HTML view for stats a compile-time option, defaulting to on. This PR doesn't change any code-paths, but it moves the HTML support into a separate file, compiled into //source/server/admin:admin_lib. In the future, and admin_html_lib will be added, built only when admin-html is not disabled. That will allow envoyproxy#19546 and ultimately envoyproxy#18670 to proceed. To disable, compile with `--define=admin_html=disabled`, in which case the admin `"/"` endpoint will just print that the thml mode was disabled. Additional Description: This PR is a step toward solving envoyproxy#18675 Risk Level: low -- this just moves code around and doesn't change it at all. Testing: //test/..., both with and without `--define=admin_html=disabled` Docs Changes: included Release Notes: included Platform Specific Features: n/a Signed-off-by: Joshua Marantz <jmarantz@google.com> Signed-off-by: Amila Senadheera <amila.15@cse.mrt.ac.lk>
This isn't something we want to expose when running Envoy Mobile. For more details: envoyproxy/envoy#21814 Signed-off-by: JP Simard <jp@jpsim.com>
Commit Message: Make the HTML view for stats a compile-time option, defaulting to on. This PR doesn't change any code-paths, but it moves the HTML support into a separate file, compiled into //source/server/admin:admin_lib. In the future, and admin_html_lib will be added, built only when admin-html is not disabled. That will allow #19546 and ultimately #18670 to proceed.
To disable, compile with
--define=admin_html=disabled, in which case the admin"/"endpoint will just print that the thml mode was disabled.Additional Description: This PR is a step toward solving #18675
Risk Level: low -- this just moves code around and doesn't change it at all.
Testing: //test/..., both with and without
--define=admin_html=disabledDocs Changes: included
Release Notes: included
Platform Specific Features: n/a