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: ApisixGlobalRule support global rules #1586

Merged
merged 4 commits into from
Jan 31, 2023

Conversation

AlinsRan
Copy link
Contributor

@AlinsRan AlinsRan commented Jan 4, 2023

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What this PR does / why we need it:

Close: #1104

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2023

Codecov Report

Merging #1586 (23755b9) into master (486b46a) will decrease coverage by 0.25%.
The diff coverage is 12.30%.

@@            Coverage Diff             @@
##           master    #1586      +/-   ##
==========================================
- Coverage   41.44%   41.18%   -0.26%     
==========================================
  Files          87       88       +1     
  Lines        7420     7485      +65     
==========================================
+ Hits         3075     3083       +8     
- Misses       3990     4043      +53     
- Partials      355      359       +4     
Impacted Files Coverage Δ
...providers/apisix/translation/apisix_global_rule.go 0.00% <0.00%> (ø)
pkg/providers/apisix/translation/translator.go 0.00% <ø> (ø)
...ess/translation/annotations/plugins/http_method.go 81.81% <ø> (ø)
pkg/providers/translation/context.go 80.95% <0.00%> (-8.53%) ⬇️
pkg/providers/utils/manifest.go 41.17% <27.58%> (-1.63%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@AlinsRan AlinsRan marked this pull request as ready for review January 6, 2023 08:10
@AlinsRan AlinsRan changed the title feat: support global rules feat: ApisixGlobalRule support global rules Jan 6, 2023
@tao12345666333 tao12345666333 added area/controller changelog Issues with this label should be added to changelog when public a new release labels Jan 6, 2023
@tao12345666333 tao12345666333 added this to the v1.7.0 milestone Jan 6, 2023
Copy link
Member

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

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

Code overall LGTM

one question, how to deal with conflicts between ApisixGlobalRule and ApisixClusterConfig?

@AlinsRan
Copy link
Contributor Author

Code overall LGTM

one question, how to deal with conflicts between ApisixGlobalRule and ApisixClusterConfig?

There are two conflicts:

  1. Construct the same name
  2. Different objects use the same plugin.

For 1, ApisixGlobalRule is a namespace-level resource that constructs objects based on namespace-name, and there is no identical name.

For 2, use plugins in different global-rules objects, APISIX does not restrict this. (Of course, we need to point it out in the documentation, or recommend users to use ApisixGlobalRule)

@tao12345666333 tao12345666333 merged commit fa57ff5 into apache:master Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller changelog Issues with this label should be added to changelog when public a new release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

request help: How to create a global rule for a cluster scoped plugin?
4 participants