Skip to content

feat: Support watching multiple namespaces #2914

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

Merged
merged 3 commits into from
Aug 22, 2022
Merged

Conversation

ciarams87
Copy link
Contributor

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

@github-actions github-actions bot added documentation Pull requests/issues for documentation enhancement Pull requests for new features/feature enhancements labels Aug 9, 2022
@ciarams87 ciarams87 force-pushed the multiple-namespaces branch from 91a90d9 to d299cf7 Compare August 9, 2022 12:16
@ciarams87 ciarams87 requested review from a team, lucacome, jjngx and shaun-nx August 9, 2022 14:48
@ciarams87 ciarams87 marked this pull request as ready for review August 9, 2022 14:48
@ciarams87 ciarams87 force-pushed the multiple-namespaces branch from d299cf7 to 18087ed Compare August 10, 2022 13:34
@codecov-commenter
Copy link

codecov-commenter commented Aug 10, 2022

Codecov Report

Merging #2914 (ebe60f4) into main (094b877) will decrease coverage by 0.72%.
The diff coverage is 14.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%) ⬇️
internal/k8s/status.go 33.27% <23.63%> (-0.97%) ⬇️
internal/certmanager/cm_controller.go 18.04% <40.00%> (-0.76%) ⬇️
cmd/nginx-ingress/flags.go 34.42% <75.00%> (+8.50%) ⬆️
internal/externaldns/sync.go 36.95% <75.00%> (+0.64%) ⬆️
internal/certmanager/sync.go 73.23% <100.00%> (+1.12%) ⬆️
...ternal/k8s/appprotect/app_protect_configuration.go 86.16% <0.00%> (-0.58%) ⬇️
... and 5 more

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

@ciarams87 ciarams87 force-pushed the multiple-namespaces branch 2 times, most recently from f1f8793 to a482c3e Compare August 11, 2022 14:37
Copy link
Contributor

@shaun-nx shaun-nx left a comment

Choose a reason for hiding this comment

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

👍

@ciarams87 ciarams87 force-pushed the multiple-namespaces branch 3 times, most recently from cde74c4 to ebe60f4 Compare August 22, 2022 15:07
Copy link
Contributor

@vepatel vepatel left a comment

Choose a reason for hiding this comment

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

👍🏼

@ciarams87 ciarams87 force-pushed the multiple-namespaces branch from ebe60f4 to 60d5736 Compare August 22, 2022 19:46
@ciarams87 ciarams87 enabled auto-merge (squash) August 22, 2022 19:46
@ciarams87 ciarams87 merged commit 6be744a into main Aug 22, 2022
@ciarams87 ciarams87 deleted the multiple-namespaces branch August 22, 2022 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests/issues for documentation enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants