Builds a filtered Operator Lifecycle Manager catalog for disconnected OpenShift installs.
The component renders a source catalog with opm, filters it to one operator package version, validates the file-based catalog, and packages a deployable Helm chart named olm-catalog-<name>. The chart serves the filtered catalog with opm serve and always includes a Service-backed CatalogSource named <operator>-catalog.
The job also writes an ImageSetConfiguration and, unless dry-run is enabled, uploads the generated chart to OCI and runs oc-mirror --v2 to copy the operator images into the target registry.
Variables
| Name | required | type | Hints |
|---|---|---|---|
| CI_REGISTRY_USER | required | string | GitLab container registry user. Provided by GitLab CI. |
| CI_REGISTRY_PASSWORD | required | string | GitLab container registry password. Provided by GitLab CI. |
Usage
Create GitLab pipeline file .gitlab-ci.yml:
include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/mirror-operator@stable
inputs:
name: cloudnative-pg
operator: cloudnative-pg
olm-catalog: registry.redhat.io/redhat/community-operator-index:v4.20
target-registry: $CI_REGISTRY_IMAGE/disconnected
catalog-registry: $CI_REGISTRY_IMAGE
catalog-source-namespace: openshift-marketplace
Deploy the generated chart from the OCI registry or from the job artifact after reviewing it:
helm upgrade --install cloudnative-pg-catalog oci://registry.gitlab.com/group/project/olm-catalog-cloudnative-pg --version <generated-version> --namespace openshift-marketplace
The generated chart uses the same automatic versioning as the Helm component: tag pipelines use the Git tag, while branch and merge request pipelines produce an unstable 0.0.0+... chart version.
By default the mirror job is manual and only available for tags. Override rules when a project wants to refresh a disconnected catalog from schedules or merge requests.
Set channel or version to narrow the operator package. When version is empty, the latest available version is used. olm-catalog accepts a catalog image or a file-based catalog directory. target-registry is the registry path for oc-mirror, and catalog-registry is the registry path for the generated Helm chart. Use dry-run: true to validate the generated image set, file-based catalog, Helm chart, and CatalogSource without copying or uploading images.
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 | Registry image used by oc-mirror to store mirror metadata. | $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-registry | Destination registry path for oc-mirror. | $CI_REGISTRY_IMAGE | string |
| version | Optional operator version to mirror. When empty, the latest available version is used. | string |