|
3 | 3 | // * operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc
|
4 | 4 | // * operators/olm_v1/arch/olmv1-operator-controller.adoc
|
5 | 5 |
|
6 |
| -:_mod-docs-content-type: CONCEPT |
| 6 | +:_mod-docs-content-type: REFERENCE |
7 | 7 |
|
8 |
| -[id="olmv1-about-operator-updates_{context}"] |
9 |
| -= About target versions in {olmv1} |
| 8 | +[id="olmv1-about-target-versions_{context}"] |
| 9 | += Example custom resources (CRs) that specify a target version |
10 | 10 |
|
11 |
| -In {olmv1-first}, cluster administrators set the target version of an Operator declaratively in the Operator's custom resource (CR). |
| 11 | +In {olmv1-first}, cluster administrators can declaratively set the target version of an Operator or extension in the custom resource (CR). |
12 | 12 |
|
13 |
| -If you specify a channel in the Operator's CR, {olmv1} installs the latest release from the specified channel. When updates are published to the specified channel, {olmv1} automatically updates to the latest release from the channel. |
| 13 | +You can define a target version by specifying any of the following fields: |
| 14 | + |
| 15 | +* Channel |
| 16 | +* Version number |
| 17 | +* Version range |
| 18 | + |
| 19 | +If you specify a channel in the CR, {olmv1} installs the latest version of the Operator or extension that can be resolved within the specified channel. When updates are published to the specified channel, {olmv1} automatically updates to the latest release that can be resolved from the channel. |
14 | 20 |
|
15 | 21 | .Example CR with a specified channel
|
16 | 22 | [source,yaml]
|
17 | 23 | ----
|
18 | 24 | apiVersion: operators.operatorframework.io/v1alpha1
|
19 | 25 | kind: Operator
|
20 | 26 | metadata:
|
21 |
| - name: quay-example |
| 27 | + name: pipelines-operator |
22 | 28 | spec:
|
23 |
| - packageName: quay-operator |
24 |
| - channel: stable-3.8 <1> |
| 29 | + packageName: openshift-pipelines-operator-rh |
| 30 | + channel: latest <1> |
25 | 31 | ----
|
26 |
| -<1> Installs the latest release published to the specified channel. Updates to the channel are automatically installed. |
| 32 | +<1> Installs the latest release that can be resolved from the specified channel. Updates to the channel are automatically installed. |
27 | 33 |
|
28 |
| -If you specify the Operator's target version in the CR, {olmv1} installs the specified version. When the target version is specified in the Operator's CR, {olmv1} does not change the target version when updates are published to the catalog. |
| 34 | +If you specify the Operator or extension's target version in the CR, {olmv1} installs the specified version. When the target version is specified in the CR, {olmv1} does not change the target version when updates are published to the catalog. |
29 | 35 |
|
30 |
| -If you want to update the version of the Operator that is installed on the cluster, you must manually update the Operator's CR. Specifying a Operator's target version pins the Operator's version to the specified release. |
| 36 | +If you want to update the version of the Operator that is installed on the cluster, you must manually edit the Operator's CR. Specifying an Operator's target version pins the Operator's version to the specified release. |
31 | 37 |
|
32 | 38 | .Example CR with the target version specified
|
33 | 39 | [source,yaml]
|
34 | 40 | ----
|
35 | 41 | apiVersion: operators.operatorframework.io/v1alpha1
|
36 | 42 | kind: Operator
|
37 | 43 | metadata:
|
38 |
| - name: quay-example |
| 44 | + name: pipelines-operator |
39 | 45 | spec:
|
40 |
| - packageName: quay-operator |
41 |
| - version: 3.8.12 <1> |
| 46 | + packageName: openshift-pipelines-operator-rh |
| 47 | + version: 1.11.1 <1> |
42 | 48 | ----
|
43 |
| -<1> Specifies the target version. If you want to update the version of the Operator that is installed on the cluster, you must manually update this field the Operator's CR to the desired target version. |
44 |
| - |
45 |
| -If you want to change the installed version of an Operator, edit the Operator's CR to the desired target version. |
| 49 | +<1> Specifies the target version. If you want to update the version of the Operator or extension that is installed, you must manually update this field the CR to the desired target version. |
46 | 50 |
|
47 |
| -[WARNING] |
48 |
| -==== |
49 |
| -In previous versions of OLM, Operator authors could define upgrade edges to prevent you from updating to unsupported versions. In its current state of development, {olmv1} does not enforce upgrade edge definitions. You can specify any version of an Operator, and {olmv1} attempts to apply the update. |
50 |
| -==== |
| 51 | +If you want to define a range of acceptable versions for an Operator or extension, you can specify a version range by using a comparison string. When you specify a version range, {olmv1} installs the latest version of an Operator or extension that can be resolved by the Operator Controller. |
51 | 52 |
|
52 |
| -You can inspect an Operator's catalog contents, including available versions and channels, by running the following command: |
53 |
| - |
54 |
| -.Command syntax |
55 |
| -[source,terminal] |
| 53 | +.Example CR with a version range specified |
| 54 | +[source,yaml] |
56 | 55 | ----
|
57 |
| -$ oc get package <catalog_name>-<package_name> -o yaml |
| 56 | +apiVersion: operators.operatorframework.io/v1alpha1 |
| 57 | +kind: Operator |
| 58 | +metadata: |
| 59 | + name: pipelines-operator |
| 60 | +spec: |
| 61 | + packageName: openshift-pipelines-operator-rh |
| 62 | + version: >1.11.1 <1> |
58 | 63 | ----
|
| 64 | +<1> Specifies that the desired version range is greater than version `1.11.1`. For more information, see "Support for version ranges". |
59 | 65 |
|
60 |
| -After you create or update a CR, create or configure the Operator by running the following command: |
| 66 | +After you create or update a CR, apply the configuration file by running the following command: |
61 | 67 |
|
62 | 68 | .Command syntax
|
63 | 69 | [source,terminal]
|
64 | 70 | ----
|
65 | 71 | $ oc apply -f <extension_name>.yaml
|
66 | 72 | ----
|
67 |
| - |
68 |
| -.Troubleshooting |
69 |
| - |
70 |
| -* If you specify a target version or channel that does not exist, you can run the following command to check the status of your Operator: |
71 |
| -+ |
72 |
| -[source,terminal] |
73 |
| ----- |
74 |
| -$ oc get operator.operators.operatorframework.io <operator_name> -o yaml |
75 |
| ----- |
76 |
| -+ |
77 |
| -.Example output |
78 |
| -[source,text] |
79 |
| ----- |
80 |
| -apiVersion: operators.operatorframework.io/v1alpha1 |
81 |
| -kind: Operator |
82 |
| -metadata: |
83 |
| - annotations: |
84 |
| - kubectl.kubernetes.io/last-applied-configuration: | |
85 |
| - {"apiVersion":"operators.operatorframework.io/v1alpha1","kind":"Operator","metadata":{"annotations":{},"name":"quay-example"},"spec":{"packageName":"quay-operator","version":"999.99.9"}} |
86 |
| - creationTimestamp: "2023-10-19T18:39:37Z" |
87 |
| - generation: 3 |
88 |
| - name: quay-example |
89 |
| - resourceVersion: "51505" |
90 |
| - uid: 2558623b-8689-421c-8ed5-7b14234af166 |
91 |
| -spec: |
92 |
| - packageName: quay-operator |
93 |
| - version: 999.99.9 |
94 |
| -status: |
95 |
| - conditions: |
96 |
| - - lastTransitionTime: "2023-10-19T18:50:34Z" |
97 |
| - message: package 'quay-operator' at version '999.99.9' not found |
98 |
| - observedGeneration: 3 |
99 |
| - reason: ResolutionFailed |
100 |
| - status: "False" |
101 |
| - type: Resolved |
102 |
| - - lastTransitionTime: "2023-10-19T18:50:34Z" |
103 |
| - message: installation has not been attempted as resolution failed |
104 |
| - observedGeneration: 3 |
105 |
| - reason: InstallationStatusUnknown |
106 |
| - status: Unknown |
107 |
| - type: Installed |
108 |
| ----- |
0 commit comments