This guide describes the opm CLI provided by the Operator Framework.

About opm

The opm CLI tool is provided by the Operator Framework for use with the Operator Bundle Format. This tool allows you to create and maintain catalogs of Operators from a list of bundles, called an index, that are similar to software repositories. The result is a container image, called an index image, which can be stored in a container registry and then installed on a cluster.

An index contains a database of pointers to Operator manifest content that can be queried through an included API that is served when the container image is run. On OKD, Operator Lifecycle Manager (OLM) can use the index image as a catalog by referencing it in a CatalogSource, which polls the image at regular intervals to enable frequent updates to installed Operators on the cluster.

Additional resources

Installing opm

You can install the opm CLI tool on your Linux, macOS, or Windows workstation.

Prerequisites
  • podman version 1.4.4+

Procedure
  1. Extract the opm binary for the operating system you want from the Operator Registry image and copy it to your local file system.

    • For Linux:

      $ oc image extract quay.io/openshift/origin-operator-registry:4.6.0 \
          --path /usr/bin/opm:. \
          --confirm
    • For macOS:

      1. Extract the binary:

        $ oc image extract quay.io/openshift/origin-operator-registry:4.6.0 \
            --path /usr/bin/darwin-amd64-opm:. \
            --confirm
      2. Rename the file to opm:

        $ mv darwin-amd64-opm opm
    • For Windows:

      1. Extract the binary:

        C:\> oc image extract quay.io/openshift/origin-operator-registry:4.6.0 \
            --path /usr/bin/windows-amd64-opm:. \
            --confirm
      2. Rename the file to opm.exe:

        C:\> rename windows-amd64-opm opm.exe
  2. For Linux or macOS, make the binary executable:

    $ chmod +x ./opm
  3. Place the file anywhere in your PATH. For example:

    • For Linux or macOS:

      $ sudo mv ./opm /usr/local/bin/
    • For Windows:

      1. Check your PATH:

        C:\> path
      2. Move the file:

        C:\> move opm.exe <directory>
  4. Verify that the client was installed correctly:

    $ opm version
    Example output
    Version: version.Version{OpmVersion:"1.12.3", GitCommit:"", BuildDate:"2020-07-01T23:18:58Z", GoOs:"linux", GoArch:"amd64"}

Additional resources