-
Notifications
You must be signed in to change notification settings - Fork 203
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
Add AZURE_TARGET_NAMESPACES to restrict the namespaces the operator watches #1559
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1559 +/- ##
=======================================
Coverage 63.41% 63.41%
=======================================
Files 178 178
Lines 11739 11739
=======================================
Hits 7444 7444
Misses 3628 3628
Partials 667 667 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
6d8e301
to
8f5a23e
Compare
This is handled in the same way as the secret naming version setting, but the more settings we add (some more are on the way), the more unwieldy it's going to be. We need to come up with a better way of making different settings testable.
Renamed them to install-tools and install-test-tools, since they're installing binaries used in the build process rather than code dependencies. Run the `go get` commands in a temp directory and dummy module so that they don't update the ASO go.mod and .sum files with dependencies that our code doesn't actually depend on.
When target namespaces are set, there's no guarantee that the operator's namespace is included. The identity finder always needs to look in the operator namespace so pass it the API reader which bypasses the filtered cache.
9fa403c
to
1c8106d
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Hmm, that doesn't seem good. Going to try one more time, otherwise I'm going to have to work something else out tomorrow. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Yay, thanks for merging @matthchr! |
What this PR does / why we need it:
Add a new configuration value AZURE_TARGET_NAMESPACES which restricts the operator to only reconciling Azure resources within the listed namespaces (comma-separated).
This enables running multiple operators that each watch their own set of namespaces and work with different credentials.
Special notes for your reviewer:
Testing is a pain for settings like this - I've used the same approach as the secret-naming version testing for now, but we need to come up with a better way to do this. The next part of the multitenancy work is a setting to put the operator into webhook-only mode, so that will have the same problem.
How does this PR make you feel:
If applicable: