Skip to content
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

tcp_proxy: remove support for v1 routes #4446

Closed

Conversation

venilnoronha
Copy link
Member

@venilnoronha venilnoronha commented Sep 17, 2018

Description: This PR serves as a prereq for #4430 by removing the support for v1 routes in TCP Proxy.

Signed-off-by: Venil Noronha [email protected]

Risk Level: Low
Testing: Existing tests suffice
Docs Changes: Added feature removal notice to version_history.rst
Release Notes: NA

/cc @ggreenway @rshriram

Copy link
Contributor

@ggreenway ggreenway left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this.

// <https://github.com/envoyproxy/envoy/issues/2441>`_. If you want to configure the filter
// using v1 config structure, please make this field a boolean with value ``true`` and configure
// via the opaque ``value`` field like is suggested in :api:`envoy/config/filter/README.md`.
DeprecatedV1 deprecated_v1 = 6 [deprecated = true];
Copy link
Contributor

Choose a reason for hiding this comment

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

Please reserve this: https://developers.google.com/protocol-buffers/docs/proto3#reserved

@htuch Any other gotchas around removing fields from proto?

@@ -378,21 +378,9 @@ void FilterJson::translateTcpProxy(
json_config.validateSchema(Json::Schema::TCP_PROXY_NETWORK_FILTER_SCHEMA);

JSON_UTIL_SET_STRING(json_config, proto_config, stat_prefix);
JSON_UTIL_SET_STRING(json_config, proto_config, cluster);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to add this. v1 config is deprecated and we're not adding new fields to it.

// required to use more complex routing in the interim.
//
// The upstream cluster to connect to. Cluster matching is done via :ref:`filter
// chain matching rules <envoy_api_msg_listener.FilterChainMatch>`.
string cluster = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Add [(validate.rules).string.min_bytes = 1]

if (proto_config.has_deprecated_v1()) {
ASSERT(proto_config.deprecated_v1().routes_size() > 0);
}
ASSERT(!proto_config.cluster().empty());
Copy link
Contributor

Choose a reason for hiding this comment

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

Since there has been no constraint on this field in the proto, I don't think it's acceptable to ASSERT this. Throw instead.

Copy link
Member Author

@venilnoronha venilnoronha Sep 17, 2018

Choose a reason for hiding this comment

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

Addressed all comments in 21ed079.

rshriram
rshriram previously approved these changes Sep 17, 2018
Copy link
Member

@rshriram rshriram left a comment

Choose a reason for hiding this comment

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

LGTM

* Mark field 6 as reserved in proto
* Add field validation to proto
* Revert json conversion for cluster field
* Add config validation

Signed-off-by: Venil Noronha <[email protected]>
ggreenway
ggreenway previously approved these changes Sep 17, 2018
Copy link
Contributor

@ggreenway ggreenway left a comment

Choose a reason for hiding this comment

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

@htuch Can you take a final pass on the proto changes? One thing I've learned is that it is sometimes really painful if we mess up the proto changes.

Signed-off-by: Venil Noronha <[email protected]>
Signed-off-by: Venil Noronha <[email protected]>
Signed-off-by: Venil Noronha <[email protected]>
@ggreenway
Copy link
Contributor

We had a discussion on slack, and before we can delete this, we need to list it in DEPRECATED.md, then wait a release cycle. So unfortunately, we can't merge this for quite awhile.

@venilnoronha
Copy link
Member Author

venilnoronha commented Sep 18, 2018


It's already covered under the v1 API turndown:
https://github.com/envoyproxy/envoy/blob/5d731878fd0134ca15d5904450a64dab0ff577a9/DEPRECATED.md#L9-L12

@ggreenway
Copy link
Contributor

It's already covered under the v1 API turndown

I think it's ambiguous whether "use of the v1 api" includes fields in the v2 api that happen to be named "deprecated_v1". For total clarity, let's add a specific mention of "tcp_proxy.deprecated_v1" being deprecated. If you don't want to, I'm happy to do it.

@htuch
Copy link
Member

htuch commented Sep 20, 2018

@ggreenway I'd make that *.deprecated_v1 if you want to update the docs, thanks.

@venilnoronha
Copy link
Member Author

I'm on it now.

@ggreenway
Copy link
Contributor

Thanks @venilnoronha!

htuch pushed a commit that referenced this pull request Sep 20, 2018
This is a followup change as requested in this comment in #4446.

Signed-off-by: Venil Noronha <[email protected]>
@ggreenway
Copy link
Contributor

I'm going to close this for now, because we need to wait until the deprecation cycle has finished to do this.

@ggreenway ggreenway closed this Sep 21, 2018
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.

4 participants