5.5.2. Version comparison strings
You can define a version range by adding a comparison string to the spec.version field in an Operator or extension’s custom resource (CR). A comparison string is a list of space- or comma-separated values and one or more comparison operators enclosed in double quotation marks ("). You can add another comparison string by including an OR, or double vertical bar (||), comparison operator between the strings.
| Comparison operator | Definition |
|---|---|
|
| Equal to |
|
| Not equal to |
|
| Greater than |
|
| Less than |
|
| Greater than or equal to |
|
| Less than or equal to |
You can specify a version range in an Operator or extension’s CR by using a range comparison similar to the following example:
Example version range comparison
apiVersion: olm.operatorframework.io/v1
kind: ClusterExtension
metadata:
name: <clusterextension_name>
spec:
namespace: <installed_namespace>
serviceAccount:
name: <service_account_installer_name>
source:
sourceType: Catalog
catalog:
packageName: <package_name>
version: ">=1.11, <1.13"
You can use wildcard characters in all types of comparison strings. OLM v1 accepts x, X, and asterisks (*) as wildcard characters. When you use a wildcard character with the equal sign (=) comparison operator, you define a comparison at the patch or minor version level.
| Wildcard comparison | Matching string |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
You can make patch release comparisons by using the tilde (~) comparison operator. Patch release comparisons specify a minor version up to the next major version.
| Patch release comparison | Matching string |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
You can use the caret (^) comparison operator to make a comparison for a major release. If you make a major release comparison before the first stable release is published, the minor versions define the API’s level of stability. In the semantic versioning (semver) specification, the first stable release is published as the 1.0.0 version.
| Major release comparison | Matching string |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|