Mirror Operator component
Mirror one OLM operator package and publish its own catalog plus a Helm chart
that creates a CatalogSource. For OpenShift platform releases use
mirror-ocp instead. Neither
component installs an operator, creates a database or combines the two workflows.
Choose the workflow
| Task | Component | Result |
|---|---|---|
| Mirror an OpenShift release | mirror-ocp | Release images and platform mirror resources; no operator packages |
| Mirror one operator | mirror-operator | Selected bundles, related images, one rebuilt catalog and its CatalogSource chart; no platform release |
Include mirror-operator separately for each operator with a unique name.
The default destination catalog is <operator>-catalog; target-catalog and
target-tag can give each package/version a separate location. Two instances
using the same destination catalog and tag will replace that catalog, not combine
packages. Use distinct tags when retaining rollback versions.
Prerequisites
- A registry reachable by both the mirror runner and cluster nodes, with enough capacity for the catalog, bundles and their related images.
- Source pull credentials and destination push credentials configured through registry authentication. The job passes the shared auth file to oc-mirror; no credentials become artifacts.
- OLM already installed on the target cluster, including the
CatalogSource,SubscriptionandOperatorGroupAPIs. The generated chart does not install OLM. - A permitted operator to install cluster mirror policies and any pull secrets. This CI job only copies registry content and publishes a chart; it does not change the cluster or its trust configuration.
Mirror MariaDB from OperatorHub
The MariaDB Operator listing
uses package mariadb-operator. The
community bundle metadata
places version 26.10.2 in channel alpha. This is an OLM channel name, not a
claim about production stability. Verify compatibility and catalog availability
before selecting a different version.
-
Copy the component's example pipeline to
.gitlab-ci.yml. Its core include is:variables:MARIADB_OPERATOR_VERSION: "26.10.2"include:- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@main- component: $CI_SERVER_FQDN/xrow-public/ci-tools/workflow@main- component: $CI_SERVER_FQDN/xrow-public/ci-tools/mirror-operator@maininputs:name: mariadboperator: mariadb-operatorchannel: alphaversion: $MARIADB_OPERATOR_VERSIONtarget-tag: $MARIADB_OPERATOR_VERSIONolm-catalog: quay.io/operatorhubio/catalog:latesttarget-registry: $CI_REGISTRY_IMAGEcatalog-registry: $CI_REGISTRY_IMAGEcatalog-source-namespace: openshift-marketplacerules:- when: manualallow_failure: false -
Run
mirror:mariadb. It publishes$CI_REGISTRY_IMAGE/mariadb-operator-catalog:26.10.2and theolm-catalog-mariadbOCI chart. The chart uses the actual CatalogSource image emitted by the successful oc-mirror run, including its digest when provided. Image copy or output validation failure prevents chart publication. -
Download
mirror-output/andimageset-config.yamlfrom the successful job. Review the resources undermirror-output/cluster-resources/. Apply the generatedImageDigestMirrorSet/ImageTagMirrorSetresources appropriate for your cluster through its normal configuration process. Do not blindly apply every file: deploy the CatalogSource with the generated chart, not twice. -
Deploy the generated chart from the artifact:
helm upgrade --install mariadb-catalog mirror-output/olm-catalog-mariadb-*.tgz \--namespace openshift-marketplaceoc get catalogsource mariadb-operator-catalog -n openshift-marketplaceExpect a
CatalogSourcereferring to the destination catalog, not the original OperatorHub image. Wait for its gRPC connection to be ready. For private registries, configure the required catalog/node pull credentials first.
The generated chart contains only a CatalogSource. OLM starts the catalog server;
there is no ConfigMap-hosted source catalog or CI Tools server deployment.
mirror-output/catalog-chart.yaml shows the exact rendered resource.
The chart uses the shared Helm version calculation: tags use the tag version;
branch/MR builds use an unstable 0.0.0+... version. The job prints the OCI chart
location; artifacts also contain the archive for that run.
Subscribe with helm-operator
The helm-operator chart creates an
OperatorGroup and Subscription. It does not copy images or deploy the catalog.
After the preceding catalog and mirror policies are ready, create
mariadb-subscription.yaml:
name: mariadb-operator
channel: alpha
source: mariadb-operator-catalog
sourceNamespace: openshift-marketplace
installPlanApproval: Manual
Install the chart using those values:
helm upgrade --install mariadb-operator \
oci://registry.gitlab.com/xrow-public/helm-operator/operator \
--namespace mariadb-system --create-namespace \
-f mariadb-subscription.yaml
oc get subscription,installplan,csv -n mariadb-system
Review and approve the generated InstallPlan with your normal cluster procedure.
Expect a successful CSV before creating MariaDB custom resources. Manual avoids
silently promoting a newly mirrored bundle. Only one OperatorGroup should own
this namespace; reconcile an existing one instead of installing a conflicting
second instance. OLM scope, supported OpenShift versions and operand registry
access remain operator-specific prerequisites.
Selection and authentication
olm-catalog is an oc-mirror source catalog image or local oci:// catalog path.
operator selects exactly one package. With an empty version, oc-mirror selects
channel heads; this is not an exact version pin or a guarantee of one bundle
across multiple channels. channel limits selection and sets defaultChannel
consistently. An explicit version sets both package version bounds. A missing
package/version, missing images or failed copy fails the job.
The upstream filtering guide
warns that selecting a historical non-head bundle can omit metadata needed for
cluster upgrades. Test installation and upgrade paths before promotion. Use a
source catalog digest for reproducibility; keep that digest and selected package
version compatible. The deprecated metadata-image input is ignored. oc-mirror
stores incremental state in mirror-workspace; preserve that workspace separately
if your controlled mirroring process needs it. It is not a job artifact.
Set dry-run: true to generate configuration and render/package the Helm chart
without registry access, image copy or upload. This is offline configuration
validation, not proof that a remote package exists or a complete disconnected
installation succeeds. Real runs retain oc-mirror's generated cluster resources
without adding its potentially large image workspace to artifacts.
Refresh with Renovate
Copy the adjacent
Renovate configuration
to renovate.json and run your existing Renovate service or
renovate-runner.
The regex manager updates MARIADB_OPERATOR_VERSION using the upstream
mariadb-operator-<version> Git tags. It excludes CRD-chart tags and keeps the
mirror's version and destination tag together through one variable. Configure
source catalog digest tracking separately if you pin olm-catalog.
Validate the configuration with renovate-config-validator renovate.json and
review the proposed Renovate version against the source OLM catalog. Git tags can
appear before community catalog publication. Merge the version update only after
catalog availability and compatibility checks, run the manual mirror job, then
promote the generated chart and review the OLM InstallPlan. A periodic schedule
with an empty version follows channel heads but is not a reviewed, pinned update.
Migration and testing
Older generated charts served a separately filtered source catalog with a tools
image. Regenerate the chart: it now uses the catalog rebuilt by oc-mirror, whose
references match the mirrored content. Existing input names are preserved; the
new target-catalog and target-tag options control catalog isolation. Empty
version selection now follows oc-mirror channel-head semantics instead of a
separate numeric version sorter. Review retained cluster resources and remove
obsolete server resources through your Helm upgrade process.
CI executes a small Python contract suite through python-unittest. It runs the
actual job shell and real Helm lint/render/package, with fixtures only for
registry operations. It covers per-operator catalogs, selection, digest output,
offline dry run, failed copy, foreign output and unsafe values. A separate compiled
component job exercises the shared bootloader and Helm helpers offline. These
checks do not transfer the full public catalog or claim cluster acceptance.
Inputs
| Name | Description | Default | Type |
| --- | --- | --- | --- |
| catalog-display-name | Display name for the generated CatalogSource. | Mirrored Operator Catalog | string |
| catalog-publisher | Publisher for the generated CatalogSource. | xrow CI Tools | string |
| catalog-registry | Registry path used to publish the generated catalog chart. | $CI_REGISTRY_IMAGE | string |
| catalog-source-namespace | Namespace where the catalog chart is deployed. | openshift-marketplace | string |
| channel | Optional operator channel to limit the mirrored package. | string | |
| dry-run | Generate and validate manifests without copying images. | false | boolean |
| metadata-image | Deprecated compatibility input. oc-mirror v2 stores metadata in the workspace. | $CI_REGISTRY_IMAGE/oc-mirror-metadata | string |
| name | Name suffix for the mirror job and generated chart release. | operator | string |
| needs | The jobs that this job depends on. | [] | array |
| olm-catalog | Source OLM catalog image or file-based catalog directory to render with opm. | quay.io/operatorhubio/catalog:latest | string |
| operator | Operator package name to mirror from the catalog. | cloudnative-pg | string |
| rules | The rules that this job depends on. | [{"if":"$CI_COMMIT_TAG","when":"manual"},{"when":"never"}] | array |
| stage | The pipeline stage that the job belongs to. | deploy | string |
| tags | The runners that this job depends on. | [] | array |
| target-catalog | Destination catalog repository name. Defaults to <operator>-catalog. | string | |
| target-registry | Destination registry path for oc-mirror. | $CI_REGISTRY_IMAGE | string |
| target-tag | Destination catalog tag. Use distinct tags when retaining older catalogs. | latest | string |
| version | Optional exact bundle version. When empty, oc-mirror selects channel heads. | string |