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

feat(api7): support API-level label selector #150

Merged
merged 4 commits into from
Jul 19, 2024

Conversation

bzp2010
Copy link
Collaborator

@bzp2010 bzp2010 commented Jul 18, 2024

Description

The current API7 backend uses an implementation that pulls completely and performs label filtering locally. This can be inefficient when the number of potential resources is high.
This PR moves label filtering to the API7 API level, where the server performs resource filtering and only returns resources that match the labeling rules.

It supports the following resource types:

  • Consumer
  • SSL

Resource types that will not be supported (These resources do not have a labels field):

  • Global Rule
  • Plugin Metadata

Resources that may be supported later:

  • Service: Right now, its not supported for labels based filtering, we will add support for it when the server starts supporting it.

Even though services do not perform API-level label filtering, label filtering will still work and its mode of operation will fall back to full pull and local filtering. This will be improved later.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible

@bzp2010 bzp2010 added the test/api7 Trigger the API7 test on the PR label Jul 18, 2024
@bzp2010 bzp2010 requested review from juzhiyuan and guoqqqi July 18, 2024 18:05
@bzp2010 bzp2010 marked this pull request as ready for review July 18, 2024 18:05
@bzp2010 bzp2010 changed the title feat: api7 API-level label selector feat(api7): support API-level label selector Jul 18, 2024
@bzp2010 bzp2010 requested a review from SkyeYoung July 19, 2024 03:42
@bzp2010 bzp2010 merged commit 9674289 into main Jul 19, 2024
7 checks passed
@bzp2010 bzp2010 deleted the bzp/feat-api7-api-level-label-selector branch July 19, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test/api7 Trigger the API7 test on the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants