Skip to content

tcp_proxy: remove support for v1 routes#4446

Closed
venilnoronha wants to merge 5 commits intoenvoyproxy:masterfrom
venilnoronha:remove-v1-tcp-routes
Closed

tcp_proxy: remove support for v1 routes#4446
venilnoronha wants to merge 5 commits intoenvoyproxy:masterfrom
venilnoronha:remove-v1-tcp-routes

Conversation

@venilnoronha
Copy link
Copy Markdown
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 veniln@vmware.com

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

/cc @ggreenway @rshriram

Signed-off-by: Venil Noronha <veniln@vmware.com>
Copy link
Copy Markdown
Member

@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
Copy Markdown
Member

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?

Comment thread source/common/config/filter_json.cc Outdated
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
Copy Markdown
Member

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.

//
// 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
Copy Markdown
Member

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
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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 <veniln@vmware.com>
ggreenway
ggreenway previously approved these changes Sep 17, 2018
Copy link
Copy Markdown
Member

@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 <veniln@vmware.com>
Signed-off-by: Venil Noronha <veniln@vmware.com>
Signed-off-by: Venil Noronha <veniln@vmware.com>
@ggreenway
Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Member

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
Copy Markdown
Member

htuch commented Sep 20, 2018

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

@venilnoronha
Copy link
Copy Markdown
Member Author

I'm on it now.

@ggreenway
Copy link
Copy Markdown
Member

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 <veniln@vmware.com>
@ggreenway
Copy link
Copy Markdown
Member

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