kubernetes-ingress
kubernetes-ingress copied to clipboard
feat: Support watching multiple namespaces
trafficstars
Proposed changes
Currently, the NGINX Ingress Controller can watch either all namespaces or a single namespace. This commit adds the ability to watch multiple namespaces (defined using by passing a comma separated list of namespaces to the -watch-namespace CLI argument instead of a single name). This is achieved by creating an informer per namespace and kind we observe.
Checklist
Before creating a PR, run through this checklist and mark each as complete.
- [ ] I have read the CONTRIBUTING doc
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have checked that all unit tests pass after adding my changes
- [ ] I have updated necessary documentation
- [ ] I have rebased my branch onto main
- [ ] I will ensure my PR is targeting the main branch and pulling from my branch from my own fork
Codecov Report
Merging #2914 (ebe60f4) into main (094b877) will decrease coverage by
0.72%. The diff coverage is14.61%.
@@ Coverage Diff @@
## main #2914 +/- ##
==========================================
- Coverage 53.03% 52.30% -0.73%
==========================================
Files 58 58
Lines 15651 15959 +308
==========================================
+ Hits 8300 8347 +47
- Misses 7074 7332 +258
- Partials 277 280 +3
| Impacted Files | Coverage Δ | |
|---|---|---|
| cmd/nginx-ingress/main.go | 0.00% <0.00%> (ø) |
|
| internal/externaldns/controller.go | 0.00% <0.00%> (ø) |
|
| internal/k8s/controller.go | 11.18% <4.65%> (-0.53%) |
:arrow_down: |
| internal/k8s/status.go | 33.27% <23.63%> (-0.97%) |
:arrow_down: |
| internal/certmanager/cm_controller.go | 18.04% <40.00%> (-0.76%) |
:arrow_down: |
| cmd/nginx-ingress/flags.go | 34.42% <75.00%> (+8.50%) |
:arrow_up: |
| internal/externaldns/sync.go | 36.95% <75.00%> (+0.64%) |
:arrow_up: |
| internal/certmanager/sync.go | 73.23% <100.00%> (+1.12%) |
:arrow_up: |
| ...ternal/k8s/appprotect/app_protect_configuration.go | 86.16% <0.00%> (-0.58%) |
:arrow_down: |
| ... and 5 more |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more