Page
Getting operators to use with oc-mirror

Before work can begin with setting operators to mirror, it is important to find the ones that are available for your environment’s specific Red Hat OpenShift version. This will ensure you are pulling the most up-to-date versions, as well as creating an accurate mirror in later steps.
Prerequisites:
- Valid Red Hat subscriptions and pull secrets for accessing the operator catalogs.
- Tools like
oc-mirror
and utilities like Podman or Skopeo for image operations.
In this lesson, you will:
- Retrieve available Operator catalogs for your OpenShift version.
- Configure and implement the
oc-mirror
plugin.
Retrieve operator catalogs
To retrieve the list of available operator catalogs for a specific OpenShift version, use the following command.
The example below demonstrates how to list catalogs for OpenShift 4.17. For comprehensive details on the OpenShift Operator Lifecycle, refer to the official documentation.
Syntax:
# oc mirror list operators --catalogs --version=<version>
Example;
[root@registry IB]# oc mirror list operators --catalogs --version=4.17 Available OpenShift OperatorHub catalogs: OpenShift 4.17: registry.redhat.io/redhat/redhat-operator-index:v4.17 registry.redhat.io/redhat/certified-operator-index:v4.17 registry.redhat.io/redhat/community-operator-index:v4.17 registry.redhat.io/redhat/redhat-marketplace-index:v4.17
Once you have identified the desired Operator catalog, you can list the available Operator packages within that catalog using the following command:
Syntax:
# oc mirror list operators --catalog=<Catalog Name>
Example:
[root@registry IB]# oc mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.17 NAME DISPLAY NAME DEFAULT CHANNEL 3scale-operator threescale-2.15 advanced-cluster-management release-2.13 amq-broker-rhel8 7.12.x amq-online stable amq-streams stable amq-streams-console alpha amq7-interconnect-operator 1.10.x [...] servicemeshoperator stable servicemeshoperator3 stable [...] tempo-product stable topology-aware-lifecycle-manager stable trustee-operator stable vertical-pod-autoscaler stable volsync-product stable web-terminal fast windows-machine-config-operator stable [root@registry IB]#
After selecting the desired Operator package, use the following command to list the channels associated with that Operator.
Syntax:
# oc mirror list operators --catalog=<Catalog Name> –package=<operator name>
Example:
[root@registry IB]# oc mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.17 --package=compliance-operator NAME DISPLAY NAME DEFAULT CHANNEL compliance-operator stable PACKAGE CHANNEL HEAD compliance-operator 4.7 compliance-operator.v0.1.32 compliance-operator release-0.1 compliance-operator.v0.1.61 compliance-operator stable compliance-operator.v1.7.0 [root@registry IB]#
Once the appropriate channel for the selected Operator is identified, use the following command to list all available versions of that Operator within the specified channel:
Syntax:
# oc mirror list operators --catalog=<Catalog Name> –package=<operator name> –channel <channel name>
Example:
[root@registry IB]# oc mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.17 --package=compliance-operator --channel stable VERSIONS 1.4.0 1.4.1 1.5.0 1.5.1 1.6.0 1.6.1 1.6.2 1.7.0
Congratulations. You have retrieved the operators you want. Now it's time to define and configure them in the next lesson.