Skip to content

Allow empty namespace to watch all namespaces. #298

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

Conversation

andersjanmyr
Copy link
Contributor

Perhaps the default should be changed in operator-sdk up local, but I didn't include in this PR.

@CSdread
Copy link
Contributor

CSdread commented Jun 6, 2018

we would love for this to be merged, this is a blocker for us as well @rithujohn191 @hasbro17 @theishshah

@spahl
Copy link
Contributor

spahl commented Jun 6, 2018

The idea with this function not allowing empty namespaces is to protect the user by default.

You can always skip using that function and pass an empty string to Watch directly. Would that work for both of your use cases?

I would also love to know more about the use cases to make sure we build the right thing here. Thanks

@CSdread
Copy link
Contributor

CSdread commented Jun 6, 2018

My use case is building operators that can be created in any non kube-system namespace. We want to watch for the CRD to be created on any namespace so we can create the resource in the specified namespace. Right now we are passing empty string to the Watch directly but it would be nice to keep this method flexible as well. In my world we have very few use-cases for watching a single namespace.

@andersjanmyr
Copy link
Contributor Author

@spahl The user will still be protected by default. Since you will explicitly have to set the variable to the empty string.

@EronWright
Copy link

@spahl are you able to merge this now?

@hasbro17 hasbro17 requested a review from fanminshi August 6, 2018 20:03
@hasbro17
Copy link
Contributor

hasbro17 commented Aug 6, 2018

@EronWright Yes I think we should be able to add this change in since it doesn't affect the default case.
/cc @fanminshi

@fanminshi
Copy link
Contributor

lgtm

@fanminshi fanminshi merged commit fa4ea18 into operator-framework:master Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants