# Exploring Operator Catalogs ## Get a OLM Catalog Item ``` $ podman run -it --rm --entrypoint /bin/cat \ registry.redhat.io/redhat/redhat-operator-index:v4.12 \ /configs/cluster-logging/catalog.json > catalog.json ``` ## Delve into the catalog item ### Get the list of related images the operator claims it uses ``` $ jq 'select(.relatedImages) | .name, .relatedImages' catalog.json "cluster-logging.5.5.18" [ { "name": "", "image": "registry.redhat.io/openshift-logging/cluster-logging-operator-bundle@sha256:cff838ced67b5b5e22338f369f9dc1d2a68651e9988579b9bf4e3974d46971b7" }, { "name": "cluster-logging-rhel8-operator-fa25efde80a1791c87d57718a9c5246161486ec972008423188a0b506ac9e499-annotation", "image": "registry.redhat.io/openshift-logging/cluster-logging-rhel8-operator@sha256:fa25efde80a1791c87d57718a9c5246161486ec972008423188a0b506ac9e499" }, { "name": "cluster-logging-operator", "image": "registry.redhat.io/openshift-logging/cluster-logging-rhel8-operator@sha256:fa25efde80a1791c87d57718a9c5246161486ec972008423188a0b506ac9e499" }, { "name": "fluentd", "image": "registry.redhat.io/openshift-logging/fluentd-rhel8@sha256:6577bee8cf07a88e9e738a19076aa7e30b9f8e2c49b68d71960cf69451218756" }, { "name": "log_file_metric_exporter", "image": "registry.redhat.io/openshift-logging/log-file-metric-exporter-rhel8@sha256:4dda1f4be0c5c348a5c158c3459075a48000e20fd5c8b1838fa77c3956678a81" }, { "name": "logging_console_plugin", "image": "registry.redhat.io/openshift-logging/logging-view-plugin-rhel8@sha256:163cdaab7108554420ea8a5440a9032ddf45eae07add52223f7a4b4c03aa2bfa" }, { "name": "vector", "image": "registry.redhat.io/openshift-logging/vector-rhel8@sha256:597d51828ce6c0b8659ec4dd750e386c82fa59056825c5d32cd4910978b330c5" } ] ... ``` ### Get the list of CSV bundles ``` $ jq 'select(.schema == "olm.bundle")| .name' catalog.json "cluster-logging.5.5.18" "cluster-logging.v5.6.1" "cluster-logging.v5.6.10" "cluster-logging.v5.6.11" "cluster-logging.v5.6.12" "cluster-logging.v5.6.13" "cluster-logging.v5.6.14" "cluster-logging.v5.6.15" "cluster-logging.v5.6.16" "cluster-logging.v5.6.2" "cluster-logging.v5.6.3" ... ``` ### Unpack all of the items in a given bundle ``` $ jq 'select(.name == "cluster-logging.v5.8.3") | .properties | .[] | select(.type == "olm.bundle.object") | .value.data' catalog.json | while read l; do echo $l | tr -d '"'|base64 -d | jq; done | less { "apiVersion": "monitoring.coreos.com/v1", "kind": "ServiceMonitor", "metadata": { "labels": { "control-plane": "cluster-logging-operator" }, "name": "cluster-logging-operator-metrics-monitor" }, "spec": { "endpoints": [ { "port": "http-metrics" } ], "namespaceSelector": {}, "selector": { "matchLabels": { "name": "cluster-logging-operator" } } } } { "apiVersion": "v1", "kind": "Service", "metadata": { ... ``` ### Get the channels ``` $ jq 'select(.schema == "olm.channel")| .name' catalog.json "stable" "stable-5.5" "stable-5.6" "stable-5.7" "stable-5.8" ```