operator-framework / kubectl-operator

Manage Kubernetes Operators from the command line
https://operatorframework.io/
Apache License 2.0
128 stars 37 forks source link

Allow installing into global-operator group #73

Closed kouk closed 1 year ago

kouk commented 2 years ago

The possibleInstallModes method doesn't deal with the special case of a target namespace being the empty string, so validation fails when installing to the global operator group. E.g.

❯ kubectl operator install cert-manager --channel stable --approval Automatic -n operators
failed to install operator: operator "cert-manager" not installable: install modes supported by operator ("AllNamespaces") not compatible with install modes supported by existing operator group ("SingleNamespace")

Add a special method to determine the operator group's supported methods. Ref: https://olm.operatorframework.io/docs/concepts/crds/operatorgroup/#installmodes-and-supported-operatorgroups

openshift-ci[bot] commented 2 years ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kouk To complete the pull request process, please assign joelanford after the PR has been reviewed. You can assign the PR to them by writing /assign @joelanford in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/operator-framework/kubectl-operator/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
kouk commented 2 years ago

/assign @joelanford

joelanford commented 1 year ago

Hi @kouk, I think the issue you were experiencing may have been solved by https://github.com/operator-framework/kubectl-operator/pull/80

On a build from main, I retried your command and got this:

$ kubectl operator install cert-manager --channel stable --approval Automatic -n operators
subscription "cert-manager" created
operator "cert-manager" installed; installed csv is "cert-manager.v1.10.2"

I'm going to close this out since it looks like its fixed, but please open another issue or PR if you see something else missing!

kouk commented 1 year ago

thanks @joelanford I can't check it right now but seems legit.