Skip to content

Bootstrap agent - #16646

Merged
yanavlasov merged 7 commits into
envoyproxy:mainfrom
greymatter-io:bootstrap_agent
Jun 3, 2021
Merged

yanavlasov merged 7 commits into
envoyproxy:mainfrom
greymatter-io:bootstrap_agent

Conversation

@justincely

@justincely justincely commented May 24, 2021 •

Copy link
Copy Markdown
Contributor

Commit Message: allow user_agent fields to be overridden from bootstrap config

Additional Description: user_agent_name, user_agent_version and user_agent_build_version all look like they're settable from the docs, but the server just sets these values from the internals. This allows the users to override them if desired, but falls back to the default behavior.

Risk Level: low

Testing: Added integration tests for using the values from the fields. But to test manually: update any of those 3 fields in the bootstrap node config to whatever valid values you want, then verify that they show up in the /config_dump output. If you omit them, the current defaults will still be populated.

Docs Changes:

Release Notes:

Platform Specific Features:

Fixes #16471

@prosper86

Copy link
Copy Markdown

Please tell me how to generate this setup? Mozilla/5.0 (Linux; Android 7.0; PRA-LA1 Build/HUAWEIPRA-LA1; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.116 Mobile Safari/537.36 binu/1078 (1ceb656684e4cf54)

@justincely

Copy link
Copy Markdown
Contributor Author

It's not clear to me what to fix on these failing builds, or if they're intermittent failures. @yanavlasov just LMK if there's something I should do at this point

@yanavlasov yanavlasov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The format error is indicated here: https://dev.azure.com/cncf/envoy/_build/results?buildId=76714&view=logs&j=c5dd2866-6ab3-5f3c-3a44-4cef0ec909b5&t=a9eb66d6-8944-5769-b3f7-476949dadcb8&l=56

It is too bad that it does not show line numbers. I just configured my editor to remove trailing whitespace when it saves a file to solve this issue.

/wait

Comment thread source/server/server.cc Resolved
@justincely

Copy link
Copy Markdown
Contributor Author

thanks, I thought trailing whitespace removal was on for all, turns out I didn't have it set editor wide but rather for a couple specific languages.

@yanavlasov yanavlasov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/wait

Comment thread source/server/server.cc Outdated
if (bootstrap_.node().user_agent_name().empty()) {
bootstrap_.mutable_node()->set_user_agent_name("envoy");
} else {
bootstrap_.mutable_node()->set_user_agent_name(bootstrap_.node().user_agent_name());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do you need the else statement? It looks noop.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks like you're right for 2 of the 3. You'll have to bear with me for a little; first time really working with this codebase and all he protos and generated bits. I was a bit confused on the node vs mutable_node and which

Looks like user_agent_name and user_agent_build_version both only need to be set IF the user hasn't set anything.

However, the user_agent_version seems to be different due to the user of the set_hidden_deprecated_build_version bit. I don't quite know why, but regardless of if bootstrap_.node().user_agent_version() has been set, it seems we still need to call bootstrap_.mutable_node()->set_hidden_envoy_deprecated_build_version() to get it to pop out in the /config_dump.

Related, though not necessarily part of this issue: it is odd to me that the output node information from /config_dump doesn't match the input for this field. It actually dumps out hidden_envoy_deprecated_build_version rather than user_agent_version

    "node": {
     "id": "bootstrap_id",
     "cluster": "bootstrap_cluster",
     "hidden_envoy_deprecated_build_version": "test",
     "user_agent_name": "test-ci-user-agent",
     "user_agent_build_version": {
      "version": {
       "major_number": 1,
       "minor_number": 19
      },

Signed-off-by: Justin Ely <[email protected]>
Signed-off-by: Justin Ely <[email protected]>
@prosper86

prosper86 commented Jun 1, 2021 via email

Copy link
Copy Markdown

@justincely

Copy link
Copy Markdown
Contributor Author

@prosper86 please open issues in the main issue tracker or ask questions in the envoy slack channel. This pull request isn't the correct place for these discussions.

Signed-off-by: Justin Ely <[email protected]>
Signed-off-by: Justin Ely <[email protected]>
@justincely

Copy link
Copy Markdown
Contributor Author

@yanavlasov do you know if/how I can run the failing test locally? I'm trying to fix the null pointer error it raises

@justincely

Copy link
Copy Markdown
Contributor Author

nvm, think i found it with

./ci/run_envoy_docker.sh './ci/do_ci.sh bazel.dev'
ci/run_envoy_docker.sh 'ci/do_ci.sh bazel.clang_tidy'

@yanavlasov
yanavlasov merged commit 3d0eb2b into envoyproxy:main Jun 3, 2021
@yanavlasov

Copy link
Copy Markdown
Contributor

Thanks

@justincely
justincely deleted the bootstrap_agent branch June 3, 2021 14:07
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
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.

bootstrap fields for user_agent overwritten internally

3 participants