4.4. Catalog content resolution
When you specify the cluster extension you want to install in a custom resource (CR), Operator Lifecycle Manager (OLM) v1 uses catalog selection to resolve what content is installed.
You can perform the following actions to control the selection of catalog content:
- Specify labels to select the catalog.
- Use match expressions to perform complex filtering across catalogs.
- Set catalog priority.
If you do not specify any catalog selection criteria, Operator Lifecycle Manager (OLM) v1 selects an extension from any available catalog on the cluster that provides the requested package.
During resolution, bundles that are not deprecated are preferred over deprecated bundles by default.
4.4.1. Catalog selection by name 링크 복사링크가 클립보드에 복사되었습니다!
When a catalog is added to a cluster, a label is created by using the value of the metadata.name field of the catalog custom resource (CR). In the CR of an extension, you can specify the catalog name by using the spec.source.catalog.selector.matchLabels field. The value of the matchLabels field uses the following format:
Example label derived from the metadata.name field
apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: <example_extension>
labels:
olm.operatorframework.io/metadata.name: <example_extension>
...
- 1
- A label derived from the
metadata.namefield and automatically added when the catalog is applied.
The following example resolves the <example_extension>-operator package from a catalog with the openshift-redhat-operators label:
Example extension CR
apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: <example_extension>
spec:
namespace: <example_namespace>
serviceAccount:
name: <example_extension>-installer
source:
sourceType: Catalog
catalog:
packageName: <example_extension>-operator
selector:
matchLabels:
olm.operatorframework.io/metadata.name: openshift-redhat-operators