Skip to content

api: add listener_address_restriction_hint in Node to hint known listening ports on the node#10370

Merged
mattklein123 merged 6 commits intoenvoyproxy:masterfrom
sanjaypujare:listener_address_restriction1
Mar 19, 2020
Merged

api: add listener_address_restriction_hint in Node to hint known listening ports on the node#10370
mattklein123 merged 6 commits intoenvoyproxy:masterfrom
sanjaypujare:listener_address_restriction1

Conversation

@sanjaypujare
Copy link
Contributor

Description: Added an optional field in Node as a generic hint to the management server about known listening ports on the node

Risk Level: Low
Testing: manually tested by compiling protos into generated Java code and using the code in a Java project
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Sanjay Pujare sanjaypujare@users.noreply.github.com

@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/.

🐱

Caused by: #10370 was opened by sanjaypujare.

see: more, trace.

@sanjaypujare
Copy link
Contributor Author

@htuch pls review

@ejona86
Copy link
Contributor

ejona86 commented Mar 12, 2020

To be more clear about the use-case: This is for cases where the server has already decided which ports it will listen on and needs configuration for those ports.

@sanjaypujare
Copy link
Contributor Author

Looked into the envoy-linux (format) failure:

-import "envoy/config/core/v3/base.proto";
+import "envoy/api/v3/core/socket_option.proto";

For some reason socket_option.proto was not properly placed in the v3 hierarchy. It should go into envoy/config/core/v3. I think I need to update some file to include socket_option.proto there.

@alyssawilk
Copy link
Contributor

@htuch @lizan given this is API work one of you up for taking this?

@markdroth
Copy link
Contributor

This was suggested by @htuch, so I assume he'll review.

@sanjaypujare
Copy link
Contributor Author

@htuch Just FYI I did try to test the changes on my Mac but there are infra/tooling problems I am unable to debug. Pls let me know if the failures are related to my changes.

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, but you need to run fix_format (to forward propagate into v3) and would be good to hear from at least one other @envoyproxy/api-shepherds
/wait

Copy link
Member

Choose a reason for hiding this comment

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

This PR looks good, just trying to see if we can maybe name this a bit more descriptively (I know I was responsible for the original suggestion :P)

How about listener_bound_addresses, listening_addresses, listener_available_addresses?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll pick listening_addresses as the shortest of them all.

@sanjaypujare
Copy link
Contributor Author

LGTM, but you need to run fix_format (to forward propagate into v3) ...

So I ran

./ci/run_envoy_docker.sh './ci/do_ci.sh fix_format'

And that finished successfully and generated following changes:

	modified:   api/BUILD
	modified:   api/envoy/api/v2/core/base.proto
	modified:   api/envoy/api/v2/core/socket_option.proto
	modified:   api/envoy/api/v2/listener.proto
	modified:   api/envoy/config/bootstrap/v2/bootstrap.proto
	modified:   api/envoy/config/bootstrap/v3/BUILD
	modified:   api/envoy/config/bootstrap/v3/bootstrap.proto
	modified:   api/envoy/config/core/v3/BUILD
	modified:   api/envoy/config/core/v3/address.proto
	modified:   api/envoy/config/core/v3/base.proto
	modified:   api/envoy/config/listener/v3/BUILD
	modified:   api/envoy/config/listener/v3/listener.proto
	modified:   generated_api_shadow/envoy/api/v2/core/address.proto
	modified:   generated_api_shadow/envoy/api/v2/core/base.proto
	modified:   generated_api_shadow/envoy/api/v2/listener.proto
	modified:   generated_api_shadow/envoy/config/bootstrap/v2/bootstrap.proto
	modified:   generated_api_shadow/envoy/config/bootstrap/v3/BUILD
	modified:   generated_api_shadow/envoy/config/bootstrap/v3/bootstrap.proto
	modified:   generated_api_shadow/envoy/config/core/v3/BUILD
	modified:   generated_api_shadow/envoy/config/core/v3/address.proto
	modified:   generated_api_shadow/envoy/config/core/v3/base.proto
	modified:   generated_api_shadow/envoy/config/listener/v3/BUILD
	modified:   generated_api_shadow/envoy/config/listener/v3/listener.proto

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	api/envoy/api/v3/
	generated_api_shadow/envoy/api/v2/core/socket_option.proto
	generated_api_shadow/envoy/api/v3/

Should I commit all these changes? And more importantly, why is socket_options under api/envoy/api/v3/core/ instead of api/envoy/config/core/v3 like other similar files?

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

@sanjaypujare good catch on the v3 file move:

  1. Yes, please add all the new shadow files.
  2. See my comment on how to ensure the new socket options file is in the right place.
    /wait

Copy link
Member

Choose a reason for hiding this comment

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

You'll need to add option (udpa.annotations.file_migrate).move_to_package = "envoy.config.core.v3"; (as done in other files in this package) for the correct file movement in v3.
`

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

LGTM at a high level as an alternate API reviewer. Thank you!

@sanjaypujare
Copy link
Contributor Author

@sanjaypujare good catch on the v3 file move:

  1. Yes, please add all the new shadow files.
  2. See my comment on how to ensure the new socket options file is in the right place.
    /wait

@htuch done. PTAL.

@htuch
Copy link
Member

htuch commented Mar 17, 2020

@sanjaypujare I think you ended up colliding with a known master breakage. Can you sync past #10426, merge master and try again?

You will also need to fix DCO: https://github.com/envoyproxy/envoy/blob/master/CONTRIBUTING.md#fixing-dco

…t about known listening ports on the node

Signed-off-by: Sanjay Pujare <sanjaypujare@users.noreply.github.com>
Signed-off-by: Sanjay Pujare <sanjaypujare@users.noreply.github.com>
Signed-off-by: Sanjay Pujare <sanjaypujare@users.noreply.github.com>
Signed-off-by: Sanjay Pujare <sanjaypujare@users.noreply.github.com>
Signed-off-by: Sanjay Pujare <sanjaypujare@users.noreply.github.com>
@sanjaypujare sanjaypujare force-pushed the listener_address_restriction1 branch from af49960 to 15ff0cc Compare March 17, 2020 23:59
@sanjaypujare
Copy link
Contributor Author

@sanjaypujare I think you ended up colliding with a known master breakage. Can you sync past #10426, merge master and try again?

You will also need to fix DCO: https://github.com/envoyproxy/envoy/blob/master/CONTRIBUTING.md#fixing-dco

Done both. PTAL.

@htuch
Copy link
Member

htuch commented Mar 18, 2020

@sanjaypujare see the docs warning:

checking consistency... /source/generated/rst/api-v3/config/core/v3/socket_option.proto.rst: WARNING: document isn't included in any toctree

I suggest adding to https://github.com/envoyproxy/envoy/blob/master/docs/root/api-v3/common_messages/common_messages.rst and https://github.com/envoyproxy/envoy/blob/master/docs/root/api-v2/common_messages/common_messages.rst as appropriate.

Signed-off-by: Sanjay Pujare <sanjaypujare@users.noreply.github.com>
@sanjaypujare
Copy link
Contributor Author

@htuch v3 common_messages.rst updated (v2 was already done).

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM

@sanjaypujare
Copy link
Contributor Author

LGTM

@htuch thanks! Once this is merged the downstream design/implementation activities will continue.

@mattklein123 mattklein123 merged commit 404d73c into envoyproxy:master Mar 19, 2020
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.

7 participants