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

Use installed namespace if WATCH_NAMESPACE not set #204

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

joelsmith
Copy link
Contributor

@joelsmith joelsmith commented Sep 19, 2023

In #192 there was an attempt to change the CSV to change the installMode from OwnNamepsace to AllNamespaces, but that change was lost during the next bundle re-generation. This PR re-makes that change in both the config and the bundle, but allows the operator to be installed in either mode. This provides flexibility allowing the operator to be installed into existing namespaces, potentially with other operators present, where the OperatorGroup is already present and annotated to require one or the other.

With the installMode AllNamespaces, WATCH_NAMESPACE may not be set especially in cases where the operator is installed to an existing namespace with an existing operatorgroup. This change allows the KEDA OLM operator to work whether it is run with a WATCH_NAMESPACE
env var or not.

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO)

@joelsmith joelsmith force-pushed the kedamain branch 2 times, most recently from ff0e43c to cff3f84 Compare September 19, 2023 04:43
@joelsmith joelsmith marked this pull request as draft September 19, 2023 05:23
@joelsmith joelsmith changed the title Use installed namespace if WATCH_NAMESPACE not set WIP: Use installed namespace if WATCH_NAMESPACE not set Sep 19, 2023
@joelsmith
Copy link
Contributor Author

joelsmith commented Sep 19, 2023

On hold pending discussion

Edit: discussed with my team and we're thinking that it would be nice to support both install modes even though the mode won't affect the operator's behavior. The advantage of supporting both is flexibility in being able to be installed in a namespace already configured for AllNamespaces. For example, on OpenShift, we recommend installing in the openshift-keda namespace, but on some OpenShift versions like Red Hat OpenShift on AWS (ROSA), the cluster admin isn't allowed to create that namespace, but could install to the openshift-operators namespace, except for the fact that it requires the AllNamespaces install mode. So that's why this PR exists -- to make it work in both scenarios.

Also, allow the operator to be installed in either OwnNamespace or
AllNamespaces installMode for better flexibility on where the operator
can be installed.

Signed-off-by: Joel Smith <joelsmith@redhat.com>
@joelsmith joelsmith changed the title WIP: Use installed namespace if WATCH_NAMESPACE not set Use installed namespace if WATCH_NAMESPACE not set Sep 21, 2023
@joelsmith joelsmith marked this pull request as ready for review September 21, 2023 23:09
@joelsmith joelsmith mentioned this pull request Sep 22, 2023
7 tasks
@joelsmith joelsmith merged commit cb0c30a into kedacore:main Sep 22, 2023
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.

2 participants