Execute opm (Operator Package Manager) commands for building and managing operator catalogs
Builds operator catalog index images and queries catalog contents using opm.
/plugin marketplace add openshift-eng/ai-helpers/plugin install olm@ai-helpers<action> [arguments...]olm:opm
/olm:opm build-index-image <catalog-path> <index-image-tag> [--cacheless] [--arch=<arch>] [--base-image=<image>] [--builder-image=<image>]
/olm:opm build-semver-index-image <semver-template-file> <index-image-tag> [--cacheless] [--arch=<arch>] [--base-image=<image>] [--builder-image=<image>]
/olm:opm generate-semver-template <bundle-list> [--output=<file>] [--major=true|false] [--minor=true|false]
/olm:opm list packages <index-ref>
/olm:opm list channels <index-ref> [package-name]
/olm:opm list bundles <index-ref> [package-name]
The olm:opm command provides a unified interface to opm (Operator Package Manager) operations for building and managing operator catalog indexes. It supports building catalog indexes, generating semver templates, and querying catalog contents.
$1: action - The action to perform:
build-index-image: Build an index from an existing catalog directorybuild-semver-index-image: Build an index from a semver templategenerate-semver-template: Generate a semver template filelist: List catalog contents (requires second argument: packages, channels, or bundles)$2+: Additional arguments specific to each action (see Actions section below)Build an operator catalog index image from an existing catalog directory.
Synopsis:
/olm:opm build-index-image <catalog-path> <index-image-tag> [--cacheless] [--arch=<arch>] [--base-image=<image>] [--builder-image=<image>]
Arguments:
$2: catalog-path - Path to the catalog directory containing the index configuration$3: index-image-tag - Full image tag for the resulting index image (e.g., quay.io/myorg/mycatalog:v1.0.0)--cacheless: Optional flag to build a cacheless image (uses scratch as base image; --base-image and --builder-image are ignored when this is set)--arch=<arch>: Optional architecture specification (default: multi for multi-arch build; can specify single arch like amd64, arm64, ppc64le, s390x)--base-image=<image>: Optional base image for the index (default: quay.io/operator-framework/opm:latest; ignored if --cacheless is set)--builder-image=<image>: Optional builder image (default: quay.io/operator-framework/opm:latest; ignored if --cacheless is set)Examples:
/olm:opm build-index-image catalog quay.io/myorg/mycatalog:v1.0.0
/olm:opm build-index-image catalog quay.io/myorg/mycatalog:v1.0.0 --cacheless
/olm:opm build-index-image catalog quay.io/myorg/mycatalog:v1.0.0 --arch=amd64
Build a multi-architecture operator catalog index image using the semver template format.
Synopsis:
/olm:opm build-semver-index-image <semver-template-file> <index-image-tag> [--cacheless] [--arch=<arch>] [--base-image=<image>] [--builder-image=<image>]
Arguments:
$2: semver-template-file - Path to the semver template configuration file (e.g., catalog-config.yaml)$3: index-image-tag - Full image tag for the resulting index image (e.g., quay.io/myorg/mycatalog:v1.0.0)--cacheless: Optional flag to build a cacheless image (uses scratch as base image; --base-image and --builder-image are ignored when this is set)--arch=<arch>: Optional architecture specification (default: multi for multi-arch build; can specify single arch like amd64, arm64, ppc64le, s390x)--base-image=<image>: Optional base image for the index (default: quay.io/operator-framework/opm:latest; ignored if --cacheless is set)--builder-image=<image>: Optional builder image (default: quay.io/operator-framework/opm:latest; ignored if --cacheless is set)Examples:
/olm:opm build-semver-index-image catalog-config.yaml quay.io/myorg/mycatalog:v1.0.0
/olm:opm build-semver-index-image catalog-config.yaml quay.io/myorg/mycatalog:v1.0.0 --cacheless
/olm:opm build-semver-index-image catalog-config.yaml quay.io/myorg/mycatalog:v1.0.0 --arch=amd64
/olm:opm build-semver-index-image catalog-config.yaml quay.io/myorg/mycatalog:v1.0.0 --arch=multi
Generate a semver template configuration file for building operator catalogs.
Synopsis:
/olm:opm generate-semver-template <bundle-list> [--output=<file>] [--major=true|false] [--minor=true|false]
Arguments:
$2: bundle-list - Comma-separated list of bundle image references (e.g., quay.io/org/bundle:v1.0.0,quay.io/org/bundle:v1.0.1)--output=<file>: Optional output file path (default: catalog-semver-config.yaml in current directory)--major=true|false: Optional flag to generate major version channels (default: true)--minor=true|false: Optional flag to generate minor version channels (default: false)Examples:
/olm:opm generate-semver-template quay.io/org/bundle:v1.0.0,quay.io/org/bundle:v1.0.1
/olm:opm generate-semver-template quay.io/org/bundle:v1.0.0,quay.io/org/bundle:v1.0.1 --output=my-catalog.yaml
/olm:opm generate-semver-template quay.io/org/bundle:v1.0.0,quay.io/org/bundle:v1.1.0 --minor=true
List all operator packages available in a catalog index.
Synopsis:
/olm:opm list packages <index-ref>
Arguments:
$2: list - Must be "list"$3: packages - Must be "packages"$4: index-ref - Catalog index reference, either:
quay.io/myorg/mycatalog:v1.0.0./catalog or /path/to/catalogExamples:
/olm:opm list packages quay.io/olmqe/nginx8518-index-test:v1
/olm:opm list packages ./catalog
List channels for operator packages in a catalog index.
Synopsis:
/olm:opm list channels <index-ref> [package-name]
Arguments:
$2: list - Must be "list"$3: channels - Must be "channels"$4: index-ref - Catalog index reference (image tag or directory path)$5: package-name (Optional) - Name of a specific package to list channels forExamples:
/olm:opm list channels quay.io/olmqe/nginx8518-index-test:v1
/olm:opm list channels quay.io/olmqe/nginx8518-index-test:v1 nginx85187
/olm:opm list channels ./catalog
List bundles for operator packages in a catalog index.
Synopsis:
/olm:opm list bundles <index-ref> [package-name]
Arguments:
$2: list - Must be "list"$3: bundles - Must be "bundles"$4: index-ref - Catalog index reference (image tag or directory path)$5: package-name (Optional) - Name of a specific package to list bundles forExamples:
/olm:opm list bundles quay.io/olmqe/nginx8518-index-test:v1
/olm:opm list bundles quay.io/olmqe/nginx8518-index-test:v1 nginx85187
/olm:opm list bundles ./catalog
$1build-index-image, build-semver-index-image, generate-semver-template, listVerify required tools are installed:
opm: which opm
podman: which podman
Based on the action, call the appropriate implementation:
build-index-image:Parse Arguments and Set Defaults
$2$3--cacheless, --arch, --base-image, --builder-imagemulti, base-image=quay.io/operator-framework/opm:latest, builder-image=quay.io/operator-framework/opm:latestVerify Catalog Directory
test -d <catalog-path>Validate Catalog
opm validate <catalog-path>
Generate Dockerfile
opm generate dockerfile <catalog-path> --base-image=scratchopm generate dockerfile <catalog-path> -b <builder-image> -i <base-image>Determine Build Platform
multi: linux/amd64,linux/arm64,linux/ppc64le,linux/s390xlinux/<arch>Create Podman Manifest
podman manifest rm <index-image-tag> 2>/dev/null || true
podman manifest create <index-image-tag>
Build Image
podman build --platform <platform-list> --manifest <index-image-tag> . -f catalog.Dockerfile
Push Manifest
podman manifest push <index-image-tag>
List Bundles in Index
opm alpha list bundles <index-image-tag>
Display Success Message
build-semver-index-image:Parse Arguments and Set Defaults
$2$3--cacheless, --arch, --base-image, --builder-imagemulti, base-image=quay.io/operator-framework/opm:latest, builder-image=quay.io/operator-framework/opm:latestVerify Template File
test -f <semver-template-file>Create Catalog and Render Template
mkdir -p catalog
opm alpha render-template semver <semver-template-file> -o yaml > catalog/index.yaml
Validate Catalog
opm validate catalog
Generate Dockerfile
opm generate dockerfile catalog --base-image=scratchopm generate dockerfile catalog -b <builder-image> -i <base-image>Determine Build Platform
multi: linux/amd64,linux/arm64,linux/ppc64le,linux/s390xlinux/<arch>Create Podman Manifest
podman manifest rm <index-image-tag> 2>/dev/null || true
podman manifest create <index-image-tag>
Build Image
podman build --platform <platform-list> --manifest <index-image-tag> . -f catalog.Dockerfile
Push Manifest
podman manifest push <index-image-tag>
List Bundles in Index
opm alpha list bundles <index-image-tag>
generate-semver-template:Parse Arguments and Set Defaults
$2--output, --major, --minorcatalog-semver-config.yaml, major=true, minor=falseValidate Bundle List
Generate YAML Content
Schema: olm.semver
GenerateMajorChannels: <major-value>
GenerateMinorChannels: <minor-value>
Candidate:
Bundles:
- Image: <bundle-1>
- Image: <bundle-2>
Write Template File
Validate Generated File
Display Success Message
/olm:opm build-semver-index-image <output-file> <image-tag>list:Parse List Type
$2 (must be packages, channels, or bundles)Parse Index Reference and Optional Package
$3$4 (for channels and bundles)Determine Reference Type
test -d <index-ref>Execute List Command
opm alpha list packages <index-ref>opm alpha list channels <index-ref> [package-name]opm alpha list bundles <index-ref> [package-name]Display Results
Format: Varies by action
On failure, displays:
podman login)catalog.Dockerfile is created in the current working directoryscratch as the base image--cacheless, the --base-image and --builder-image options are ignored (scratch is always used as base)quay.io/org/image:tag not quay/org/image:tag)/olm:install - Install an operator using OLM/olm:catalog - Manage catalog sources/olm:debug - Debug OLM issues