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 namespace and multi-catalog support for describe and list-available #81

Conversation

cdjohnson
Copy link
Contributor

The describe and list-available commands made assumptions on an operator existing in only one catalog. It also did not understand namespace-scoped catalogs resulting in incomplete results. It now honors the context namespace as well as the -n override option to properly detect global vs. namespace-scoped catalogs.

I also added additional catalog metadata to the output.

Example output of describe when a package exists in two catalogs at the Global and Namespace scopes:

> bin/kubectl-operator describe ibm-mq  
== Catalog ==
Scope: Namespaced
Namespace: default
Name: ibm-operator-catalog2
Display Name: IBM Operator Catalog
Publisher: IBM Content

== Package ==
IBM MQ 2.1.0 (by IBM)

== Repository ==
N/A

== Channels ==
v1.0
v1.1
v1.2
v1.3-eus
v1.4
v1.5
v1.6
v1.7
v1.8
v2.0
v2.1 (default) (shown)

== Install Modes ==
AllNamespaces
OwnNamespace
SingleNamespace

== Description ==
IBM MQ is an operator to manage the life cycle of IBM MQ queue managers. This operator is available standalone, or as part of the IBM Cloud Pak for Integration (CP4I).

== Catalog ==
Scope: Global
Name: ibm-operator-catalog
Display Name: IBM Operator Catalog
Publisher: IBM Content

== Package ==
IBM MQ 2.1.0 (by IBM)

== Repository ==
N/A

== Channels ==
v1.0
v1.1
v1.2
v1.3-eus
v1.4
v1.5
v1.6
v1.7
v1.8
v2.0
v2.1 (default) (shown)

== Install Modes ==
AllNamespaces
OwnNamespace
SingleNamespace

== Description ==
IBM MQ is an operator to manage the life cycle of IBM MQ queue managers. This operator is available standalone, or as part of the IBM Cloud Pak for Integration (CP4I).

Example output of list-available when a package exists in two catalogs at the Global and Namespace scopes:

> bin/kubectl-operator list-available -n default
NAME                                              NAMESPACE   CATALOG                   CHANNEL                    LATEST CSV  
ibm-mq                                            restricted  ibm-operator-catalog      v1.0                       ibm-mq.v1.0.0                                            36m
ibm-mq                                            restricted  ibm-operator-catalog      v1.1                       ibm-mq.v1.1.0                                            36m
ibm-mq                                            restricted  ibm-operator-catalog      v1.2                       ibm-mq.v1.2.0                                            36m
ibm-mq                                            restricted  ibm-operator-catalog      v1.3-eus                   ibm-mq.v1.3.8                                            36m
ibm-mq                                            restricted  ibm-operator-catalog      v1.4                       ibm-mq.v1.4.0                                            36m
ibm-mq                                            restricted  ibm-operator-catalog      v1.5                       ibm-mq.v1.5.0                                            36m
ibm-mq                                            restricted  ibm-operator-catalog      v1.6                       ibm-mq.v1.6.0                                            36m
ibm-mq                                            restricted  ibm-operator-catalog      v1.7                       ibm-mq.v1.7.0                                            36m
ibm-mq                                            restricted  ibm-operator-catalog      v1.8                       ibm-mq.v1.8.2                                            36m
ibm-mq                                            restricted  ibm-operator-catalog      v2.0                       ibm-mq.v2.0.4                                            36m
ibm-mq                                            restricted  ibm-operator-catalog      v2.1                       ibm-mq.v2.1.0                                            36m
ibm-mq                                                        ibm-operator-catalog      v1.0                       ibm-mq.v1.0.0                                            27d
ibm-mq                                                        ibm-operator-catalog      v1.1                       ibm-mq.v1.1.0                                            27d
ibm-mq                                                        ibm-operator-catalog      v1.2                       ibm-mq.v1.2.0                                            27d
ibm-mq                                                        ibm-operator-catalog      v1.3-eus                   ibm-mq.v1.3.8                                            27d
ibm-mq                                                        ibm-operator-catalog      v1.4                       ibm-mq.v1.4.0                                            27d
ibm-mq                                                        ibm-operator-catalog      v1.5                       ibm-mq.v1.5.0                                            27d
ibm-mq                                                        ibm-operator-catalog      v1.6                       ibm-mq.v1.6.0                                            27d
ibm-mq                                                        ibm-operator-catalog      v1.7                       ibm-mq.v1.7.0                                            27d
ibm-mq                                                        ibm-operator-catalog      v1.8                       ibm-mq.v1.8.2                                            27d
ibm-mq                                                        ibm-operator-catalog      v2.0                       ibm-mq.v2.0.4                                            27d
ibm-mq                                                        ibm-operator-catalog      v2.1                       ibm-mq.v2.1.0                                            27d

Note: I purposely injected the NAMESPACE value into the list-available output. Since this is supposed to be a human-readable file, I'm assuming we do not need to preserve backward compatibility. I could add it at the end, but it would be unnatural. If this were to be a machine-readable tool, then I assume we would add a -o json option.

Signed-off-by: cdjohnson <cdjohnson@us.ibm.com>
Signed-off-by: cdjohnson <cdjohnson@us.ibm.com>
@openshift-ci
Copy link

openshift-ci bot commented Nov 23, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cdjohnson
Once this PR has been reviewed and has the lgtm label, please assign joelanford for approval by writing /assign @joelanford in a comment. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 18, 2023
@openshift-merge-robot
Copy link

@cdjohnson: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@perdasilva
Copy link
Contributor

@perdasilva perdasilva closed this May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants