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

ext_proc: Add per-route configuration #17691

Merged
merged 9 commits into from
Sep 8, 2021
Merged

Conversation

gbrail
Copy link
Contributor

@gbrail gbrail commented Aug 12, 2021

Commit Message: ext_proc: Add per-route configuration for processing mode and "disabled" flag.
Additional Description:
Risk Level: Low. Not triggered unless configured.
Testing: New unit and integration tests added.
Docs Changes:
Release Notes:
Platform Specific Features:

Today "disabled" and the processing mode are the two things supported
because that is what is currently supported in ext_proc.

Signed-off-by: Gregory Brail <gregbrail@google.com>
@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #17691 was opened by gbrail.

see: more, trace.

@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/envoy/.
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to api/envoy/.

🐱

Caused by: #17691 was opened by gbrail.

see: more, trace.

Signed-off-by: Gregory Brail <gregbrail@google.com>
Signed-off-by: Gregory Brail <gregbrail@google.com>
@gbrail gbrail marked this pull request as ready for review August 14, 2021 00:55
@gbrail gbrail requested a review from snowp as a code owner August 14, 2021 00:55
@wrowe
Copy link
Contributor

wrowe commented Aug 17, 2021

Ping @markdroth?

gbrail added 2 commits August 19, 2021 21:06
Simplify tests using more helpers.

Signed-off-by: Gregory Brail <gregbrail@google.com>
Signed-off-by: Gregory Brail <gregbrail@google.com>
@soulxu
Copy link
Member

soulxu commented Aug 19, 2021

thanks for update, lgtm

Signed-off-by: Gregory Brail <gregbrail@google.com>
Signed-off-by: Gregory Brail <gregbrail@google.com>
@markdroth
Copy link
Contributor

/lgtm api

Copy link
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

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

Thanks, looks good just one question

/wait

source/extensions/filters/http/ext_proc/ext_proc.h Outdated Show resolved Hide resolved
Comment on lines +1345 to +1346
// Set up configuration on the virtual host and on the route and see that
// the two are merged.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this how the other per route configurations work? I may be misremembering but I thought most they wouldn't merge, but pick the most specific one

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 find this confusing myself. I copied the language in the .proto from the ext_authz proto, which says, "If disabled is specified in multiple per-filter-configs, the most specific one will be used."

I think that this is the right logic for this. In the future, we'll implement overrides for request and response properties, and in that case I think that we might want to try and merge them if that makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So for the two properties that are supported today, the behavior is indeed to pick the most specific one -- but we might choose something different for the properties that aren't supported yet.

Copy link
Member

@soulxu soulxu Sep 2, 2021

Choose a reason for hiding this comment

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

If the most specific one is your choice, then sounds like using this method is most simple for you (Sorry, I missed that from previous review)

/**
* The non template implementation of resolveMostSpecificPerFilterConfig. see
* resolveMostSpecificPerFilterConfig for docs.
*/
const Router::RouteSpecificFilterConfig*
resolveMostSpecificPerFilterConfigGeneric(const std::string& filter_name,
const Router::RouteConstSharedPtr& route);

Also, the properties ExtProcOverrides overrides is named as overrides, so it doesn't sounds like extendable for future you want to merge them also.

ExtAuthz using the merge logic, but it is mixed also.

https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/ext_authz/v3/ext_authz.proto#envoy-v3-api-msg-extensions-filters-http-ext-authz-v3-checksettings

Only the context_extensions has the merge logic, Other fields is the most specific one logic.

Maybe we can follow the ExtAuthz, don't name the field with override name, or we design something else to explicitly specific override or merge.

Copy link
Contributor

Choose a reason for hiding this comment

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

After chatting a bit with other maintainers I think this is fine, as the behavior appears to be documented.

Signed-off-by: Gregory Brail <gregbrail@google.com>
Signed-off-by: Gregory Brail <gregbrail@google.com>
Copy link
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

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

Sorry for the delay here, this seems good to me.

@snowp snowp merged commit 01ea37b into envoyproxy:main Sep 8, 2021
@gbrail gbrail deleted the greg-per-route branch September 16, 2021 19:36
tyxia pushed a commit to tyxia/envoy that referenced this pull request Sep 21, 2021
Today "disabled" and the processing mode are the two things supported
because that is what is currently supported in ext_proc.

Signed-off-by: Gregory Brail <gregbrail@google.com>

Signed-off-by: Greg Brail <gbrail@users.noreply.github.com>
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.

5 participants