Skip to content

ext_proc: Add per-route configuration - #17691

Merged
snowp merged 9 commits into
envoyproxy:mainfrom
gbrail:greg-per-route
Sep 8, 2021
Merged

snowp merged 9 commits into
envoyproxy:mainfrom
gbrail:greg-per-route

Conversation

@gbrail

@gbrail gbrail commented Aug 12, 2021

Copy link
Copy Markdown
Contributor

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 <[email protected]>
@repokitteh-read-only

Copy link
Copy Markdown

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

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.

@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

wrowe commented Aug 17, 2021

Copy link
Copy Markdown
Contributor

Ping @markdroth?

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

Signed-off-by: Gregory Brail <[email protected]>
@soulxu

soulxu commented Aug 19, 2021

Copy link
Copy Markdown
Member

thanks for update, lgtm

@markdroth

Copy link
Copy Markdown
Contributor

/lgtm api

@snowp snowp 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.

Thanks, looks good just one question

/wait

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

@soulxu soulxu Sep 2, 2021 •

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.

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

@snowp snowp 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.

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 <[email protected]>

Signed-off-by: Greg Brail <[email protected]>
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