From e3b30f11b7971d60a71a3387d6f302faa4489895 Mon Sep 17 00:00:00 2001 From: Judd Maltin Date: Fri, 15 Mar 2024 15:15:25 -0400 Subject: [PATCH] add docs on dumping the catalog snapshot (#7689) * find the versions of the operators in the catalog snapshots --- docs/Operator_Catalog_Snapshots.adoc | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/Operator_Catalog_Snapshots.adoc b/docs/Operator_Catalog_Snapshots.adoc index b87b210b6c1..9d8f6386766 100644 --- a/docs/Operator_Catalog_Snapshots.adoc +++ b/docs/Operator_Catalog_Snapshots.adoc @@ -21,7 +21,7 @@ There are 4 catalogs in OpenShift (as of July 2020): An operator catalog snapshot is created by building a container image containing the YAML definitions of a catalog at that particular state in time. Once the catalog image has been built it needs to be hosted in a (public) container registry. -This image should no longer change - even if the online catalogs get updated with newer releases of any given operator. This is achieved by tagging the image with a unique tag. +This image should no longer change - even if the online catalogs get updated with newer releases of any given operator. This is achieved by tagging the image with a unique tag. Once the catalog snapshot image is available a catalog source can be created in OpenShift that points to this particular catalog image thus freezing the available operator versions. @@ -39,6 +39,32 @@ The full process for creating an operator catalog snapshot image is: . Wait for the operator to be running. . Optional: Create the custom resources for the operator to "do its magic". +== Dumping all the entries from a catalog snapshot image + +Prerequisites: + +* Install `opm` from https://mirror.openshift.com/pub/openshift-v4/ +* Install `podman` + +Procedure: + +* Login to the https://quay.io/repository/gpte-devops-automation/olm_snapshot_redhat_catalog?tab=tags&tag=latest[container registry] +** `podman login quay.io` +* Browse the WWW to: https://quay.io/repository/gpte-devops-automation/ +* Choose the snapshot image that matches the date you want and the OCP version you want +** e.g. `v4.14_2024_03_11` +* Click on the "Fetch Tag" button and use the UI to copy get the image, tag, and digest +** e.g. `quay.io/gpte-devops-automation/olm_snapshot_redhat_catalog@sha256:664bfd475d0b1e7690c761fd9c59530cee5de830016bb672568867c440aa463f` +* Run `opm render` to get the YAML definition of the catalog ++ +[source] +---- +mkdir ~/catalog +opm render quay.io/gpte-devops-automation/olm_snapshot_redhat_catalog@sha256:664bfd475d0b1e7690c761fd9c59530cee5de830016bb672568867c440aa463f -oyaml > ~/catalog/index.yaml +---- ++ +* Browse the YAML file for `entries` stanzas which might have your desired operators. + == Preparing to create an operator catalog snapshot image * Determine the catalogs for which you want to create a catalog snapshot image.