Skip to main content

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​

TaskComponentResult
Mirror an OpenShift releasemirror-ocpRelease images and platform mirror resources; no operator packages
Mirror one operatormirror-operatorSelected 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, Subscription and OperatorGroup APIs. 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.

  1. 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@main
    inputs:
    name: mariadb
    operator: mariadb-operator
    channel: alpha
    version: $MARIADB_OPERATOR_VERSION
    target-tag: $MARIADB_OPERATOR_VERSION
    olm-catalog: quay.io/operatorhubio/catalog:latest
    target-registry: $CI_REGISTRY_IMAGE
    catalog-registry: $CI_REGISTRY_IMAGE
    catalog-source-namespace: openshift-marketplace
    rules:
    - when: manual
    allow_failure: false
  2. Run mirror:mariadb. It publishes $CI_REGISTRY_IMAGE/mariadb-operator-catalog:26.10.2 and the olm-catalog-mariadb OCI 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.

  3. Download mirror-output/ and imageset-config.yaml from the successful job. Review the resources under mirror-output/cluster-resources/. Apply the generated ImageDigestMirrorSet/ImageTagMirrorSet resources appropriate for your cluster through its normal configuration process. Do not blindly apply every file: deploy the CatalogSource with the generated chart, not twice.

  4. Deploy the generated chart from the artifact:

    helm upgrade --install mariadb-catalog mirror-output/olm-catalog-mariadb-*.tgz \
    --namespace openshift-marketplace
    oc get catalogsource mariadb-operator-catalog -n openshift-marketplace

    Expect a CatalogSource referring 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​

NameDescriptionDefaultType
------------
catalog-display-nameDisplay name for the generated CatalogSource.Mirrored Operator Catalogstring
catalog-publisherPublisher for the generated CatalogSource.xrow CI Toolsstring
catalog-registryRegistry path used to publish the generated catalog chart.$CI_REGISTRY_IMAGEstring
catalog-source-namespaceNamespace where the catalog chart is deployed.openshift-marketplacestring
channelOptional operator channel to limit the mirrored package.string
dry-runGenerate and validate manifests without copying images.falseboolean
metadata-imageDeprecated compatibility input. oc-mirror v2 stores metadata in the workspace.$CI_REGISTRY_IMAGE/oc-mirror-metadatastring
nameName suffix for the mirror job and generated chart release.operatorstring
needsThe jobs that this job depends on.[]array
olm-catalogSource OLM catalog image or file-based catalog directory to render with opm.quay.io/operatorhubio/catalog:lateststring
operatorOperator package name to mirror from the catalog.cloudnative-pgstring
rulesThe rules that this job depends on.[{"if":"$CI_COMMIT_TAG","when":"manual"},{"when":"never"}]array
stageThe pipeline stage that the job belongs to.deploystring
tagsThe runners that this job depends on.[]array
target-catalogDestination catalog repository name. Defaults to <operator>-catalog.string
target-registryDestination registry path for oc-mirror.$CI_REGISTRY_IMAGEstring
target-tagDestination catalog tag. Use distinct tags when retaining older catalogs.lateststring
versionOptional exact bundle version. When empty, oc-mirror selects channel heads.string