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: add plugin_config_namespace parameter to ApisixRoute #2137

Merged
merged 16 commits into from
Jan 18, 2024

Conversation

Revolyssup
Copy link
Contributor

Add plugin_config_namespace parameter to ApisixRoute resource to allow cross namespace discovery.

fixes #2132

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches
  • Documentation
  • Refactor
  • Chore
  • CI/CD or Tests

What this PR does / why we need it:

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

Add plugin_config_namespace parameter to ApisixRoute resource to allow cross namespace discovery.
Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (10059af) 37.37% compared to head (0a33353) 37.39%.
Report is 3 commits behind head on master.

❗ Current head 0a33353 differs from pull request most recent head 4375bab. Consider uploading reports for the commit 4375bab to get more accurate results

Files Patch % Lines
pkg/providers/apisix/translation/apisix_route.go 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2137      +/-   ##
==========================================
+ Coverage   37.37%   37.39%   +0.02%     
==========================================
  Files          94       94              
  Lines        7966     7972       +6     
==========================================
+ Hits         2977     2981       +4     
- Misses       4596     4597       +1     
- Partials      393      394       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
Copy link
Member

@Gallardot Gallardot left a comment

Choose a reason for hiding this comment

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

Good job. Rest LGTM.

pkg/providers/apisix/apisix_route.go Outdated Show resolved Hide resolved
go.mod Outdated
@@ -113,4 +113,4 @@ require (
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove EOL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my editor autoformatted this. I'll remove this

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
@Revolyssup
Copy link
Contributor Author

@AlinsRan I removed the unnecessary go.mod changes. Can you review it again?

Copy link
Member

@Gallardot Gallardot left a comment

Choose a reason for hiding this comment

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

Thanks. @Revolyssup

@Gallardot Gallardot merged commit 96510b6 into apache:master Jan 18, 2024
79 checks passed
Gallardot added a commit to Gallardot/apisix-ingress-controller that referenced this pull request Jan 26, 2024
* feat: add plugin_config_namespace parameter to ApisixRoute

Add plugin_config_namespace parameter to ApisixRoute resource to allow cross namespace discovery.

* fix indentation

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* remove route.yaml

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* fix e2e test

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* update gomod gosum

* fix e2e test

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* fix e2e test

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* Update pkg/providers/apisix/apisix_route.go

Co-authored-by: Gallardot <gallardot@apache.org>

* create namespace

* refactor test

* refactor test

* fix e2e

* fix e2e

* update crd

* Add EOL

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

---------

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
Co-authored-by: Gallardot <gallardot@apache.org>
Revolyssup added a commit to Revolyssup/apisix-ingress-controller that referenced this pull request Apr 12, 2024
* feat: add plugin_config_namespace parameter to ApisixRoute

Add plugin_config_namespace parameter to ApisixRoute resource to allow cross namespace discovery.

* fix indentation

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* remove route.yaml

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* fix e2e test

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* update gomod gosum

* fix e2e test

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* fix e2e test

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* Update pkg/providers/apisix/apisix_route.go

Co-authored-by: Gallardot <gallardot@apache.org>

* create namespace

* refactor test

* refactor test

* fix e2e

* fix e2e

* update crd

* Add EOL

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

---------

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
Co-authored-by: Gallardot <gallardot@apache.org>
Revolyssup added a commit that referenced this pull request Apr 12, 2024
* docs: clarify usage of external service discovery (#2124)

* feat: add plugin_config_namespace parameter to ApisixRoute (#2137)

* feat: add plugin_config_namespace parameter to ApisixRoute

Add plugin_config_namespace parameter to ApisixRoute resource to allow cross namespace discovery.

* fix indentation

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* remove route.yaml

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* fix e2e test

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* update gomod gosum

* fix e2e test

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* fix e2e test

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* Update pkg/providers/apisix/apisix_route.go

Co-authored-by: Gallardot <gallardot@apache.org>

* create namespace

* refactor test

* refactor test

* fix e2e

* fix e2e

* update crd

* Add EOL

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

---------

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
Co-authored-by: Gallardot <gallardot@apache.org>

* fix: remove path validation (#2140)

* docs: update NOTICE (#2149)

* refactor(cmd/ingress): invert signal ctx logic (#2139)

* refactor(cmd/ingress): invert signal ctx logic

this commit changes the signal handling in cmd/ingress to be wrapped in
a context, and inverts which goroutine runs the controller and
which watches for the context to be cancelled, which allows some
scaffolding (`sync.WaitGroup`) to be removed and now properly handles
the controller exiting with `nil` (as it does when leader election
fails)

* test: failing flaky unit test (#2151)

* fix: failing flaky unit test

* chore(ci): remove tao12345666333 and lingsamuel in reviewers (#2150)

* chore(deps): bump github.com/onsi/ginkgo/v2 in /test/e2e (#2177)

Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.13.2 to 2.16.0.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](onsi/ginkgo@v2.13.2...v2.16.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump k8s.io/apimachinery from 0.29.0 to 0.29.2 in /test/e2e (#2161)

Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.29.0 to 0.29.2.
- [Commits](kubernetes/apimachinery@v0.29.0...v0.29.2)

---
updated-dependencies:
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump k8s.io/api from 0.29.0 to 0.29.2 in /test/e2e (#2163)

Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.29.0 to 0.29.2.
- [Commits](kubernetes/api@v0.29.0...v0.29.2)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump go.uber.org/zap from 1.26.0 to 1.27.0 in /test/e2e (#2172)

Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.26.0 to 1.27.0.
- [Release notes](https://github.com/uber-go/zap/releases)
- [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md)
- [Commits](uber-go/zap@v1.26.0...v1.27.0)

---
updated-dependencies:
- dependency-name: go.uber.org/zap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump k8s.io/client-go from 0.29.0 to 0.29.2 in /test/e2e (#2162)

Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.29.0 to 0.29.2.
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](kubernetes/client-go@v0.29.0...v0.29.2)

---
updated-dependencies:
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump k8s.io/apimachinery from 0.29.2 to 0.29.3 in /test/e2e (#2185)

Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.29.2 to 0.29.3.
- [Commits](kubernetes/apimachinery@v0.29.2...v0.29.3)

---
updated-dependencies:
- dependency-name: k8s.io/apimachinery
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: upgrade etcd-adapter to latest version (#2205)

* chore(deps): bump github.com/spf13/cobra from 1.7.0 to 1.8.0 (#2196)

Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](spf13/cobra@v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github.com/onsi/ginkgo/v2 in /test/e2e (#2195)

Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.16.0 to 2.17.1.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](onsi/ginkgo@v2.16.0...v2.17.1)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: use force=true to hard delete the apisix resource (#2210)

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>

* chore: remove redundant logs and improve logs for users (#2206)

* chore: remove redundant logs and improve error when upstream is created

Co-authored-by: AlinsRan <alinsran333@gmail.com>


---------

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Gallardot <gallardot@apache.org>
Co-authored-by: Leigang Zhang <71714656+zll600@users.noreply.github.com>
Co-authored-by: Aurelia <aurelia@acuteaura.net>
Co-authored-by: AlinsRan <alinsran333@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@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
4 participants