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

Add watch-namespaces to spicedb-operator cmd #331

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

sumedha-redd
Copy link
Contributor

@sumedha-redd sumedha-redd commented Jul 29, 2024

#291 (comment)

Introduce --watch-namespaces argument to the spicedb-operator cmd, which accepts a comma-separated list of namespaces to watch. Update the controller to set up informers for each namespace. If the argument is not set, the operator continues to work at a cluster-wide level using NamespaceAll.

Copy link

github-actions bot commented Jul 29, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@sumedha-redd
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@sumedha-redd
Copy link
Contributor Author

recheck

authzedbot added a commit to authzed/cla that referenced this pull request Jul 29, 2024
Copy link
Contributor

@ecordell ecordell left a comment

Choose a reason for hiding this comment

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

Couple of small comments. I'd also like to see a test for this (showing that the operator can't see objects in namespaces it hasn't been given access to) - let me know if that's something you think you can tackle; I can follow up with it later if needed.

pkg/cmd/run/run.go Outdated Show resolved Hide resolved
pkg/cmd/run/run.go Outdated Show resolved Hide resolved
pkg/cmd/run/run.go Outdated Show resolved Hide resolved
@sumedha-redd
Copy link
Contributor Author

@ecordell Thanks for the feedback!
Regarding adding a test for this — I looked into the e2e suite and tried updating the operator options here to set Options.WatchNamespaces with a random namespace name. This caused the tests to fail with errors while fetching resources, which seems like the expected behavior here.
I'm not sure how to go about updating the cmd Options for the operator only for a specific test case though. Could you help with that?

Copy link
Contributor

@ecordell ecordell left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @sumedha-redd - let's go ahead and merge this and I'll follow up with a PR adding a test

@ecordell ecordell marked this pull request as ready for review August 1, 2024 16:07
@ecordell ecordell requested a review from a team August 1, 2024 16:07
@ecordell ecordell added this pull request to the merge queue Aug 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2024
Merged via the queue into authzed:main with commit 24d60c6 Aug 1, 2024
12 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants