|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc |
| 4 | + |
| 5 | +:_content-type: CONCEPT |
| 6 | + |
| 7 | +[id="olmv1-about-operator-updates_{context}"] |
| 8 | += About target versions in OLM 1.0 |
| 9 | + |
| 10 | +In Operator Lifecycle Manager 1.0, cluster administrators set the target version of an Operator declaratively in the Operator's custom resource (CR). |
| 11 | + |
| 12 | +If you specify a channel in the Operator's CR, OLM 1.0 installs the latest release from the specified channel. When updates are published to the specified channel, OLM 1.0 automatically updates to the latest release from the channel. |
| 13 | + |
| 14 | +.Example CR with a specified channel |
| 15 | +[source,yaml] |
| 16 | +---- |
| 17 | +apiVersion: operators.operatorframework.io/v1alpha1 |
| 18 | +kind: Operator |
| 19 | +metadata: |
| 20 | + name: quay-example |
| 21 | +spec: |
| 22 | + packageName: quay-operator |
| 23 | + channel: stable-3.8 <1> |
| 24 | +---- |
| 25 | +<1> Installs the latest release published to the specified channel. Updates to the channel are automatically installed. |
| 26 | + |
| 27 | +If you specify the Operator's target version in the CR, OLM 1.0 installs the specified version. When the target version is specified in the Operator's CR, OLM 1.0 does not change the target version when updates are published to the catalog. |
| 28 | + |
| 29 | +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. |
| 30 | + |
| 31 | +.Example CR with the target version specified |
| 32 | +[source,yaml] |
| 33 | +---- |
| 34 | +apiVersion: operators.operatorframework.io/v1alpha1 |
| 35 | +kind: Operator |
| 36 | +metadata: |
| 37 | + name: quay-example |
| 38 | +spec: |
| 39 | + packageName: quay-operator |
| 40 | + version: 3.8.12 <1> |
| 41 | +---- |
| 42 | +<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. |
| 43 | + |
| 44 | +If you want to change the installed version of an Operator, edit the Operator's CR to the desired target version. |
| 45 | + |
| 46 | +[WARNING] |
| 47 | +==== |
| 48 | +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, OLM 1.0 does not enforce upgrade edge definitions. You can specify any version of an Operator, and OLM 1.0 attempts to apply the update. |
| 49 | +==== |
| 50 | + |
| 51 | +You can inspect an Operator's catalog contents, including available versions and channels, by running the following command: |
| 52 | + |
| 53 | +.Command syntax |
| 54 | +[source,terminal] |
| 55 | +---- |
| 56 | +$ oc get package <catalog_name>-<package_name> -o yaml |
| 57 | +---- |
| 58 | + |
| 59 | +After a you create or update a CR, create or configure the Operator by running the following command: |
| 60 | + |
| 61 | +.Command syntax |
| 62 | +[source,terminal] |
| 63 | +---- |
| 64 | +$ oc apply -f <extension_name>.yaml |
| 65 | +---- |
| 66 | + |
| 67 | +.Troubleshooting |
| 68 | + |
| 69 | +* 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: |
| 70 | ++ |
| 71 | +[source,terminal] |
| 72 | +---- |
| 73 | +$ oc get operators.operators.operatorframework.io <operator_name> -o yaml |
| 74 | +---- |
| 75 | ++ |
| 76 | +.Example output |
| 77 | +[source,text] |
| 78 | +---- |
| 79 | +apiVersion: operators.operatorframework.io/v1alpha1 |
| 80 | +kind: Operator |
| 81 | +metadata: |
| 82 | + annotations: |
| 83 | + kubectl.kubernetes.io/last-applied-configuration: | |
| 84 | + {"apiVersion":"operators.operatorframework.io/v1alpha1","kind":"Operator","metadata":{"annotations":{},"name":"quay-example"},"spec":{"packageName":"quay-operator","version":"999.99.9"}} |
| 85 | + creationTimestamp: "2023-10-19T18:39:37Z" |
| 86 | + generation: 3 |
| 87 | + name: quay-example |
| 88 | + resourceVersion: "51505" |
| 89 | + uid: 2558623b-8689-421c-8ed5-7b14234af166 |
| 90 | +spec: |
| 91 | + packageName: quay-operator |
| 92 | + version: 999.99.9 |
| 93 | +status: |
| 94 | + conditions: |
| 95 | + - lastTransitionTime: "2023-10-19T18:50:34Z" |
| 96 | + message: package 'quay-operator' at version '999.99.9' not found |
| 97 | + observedGeneration: 3 |
| 98 | + reason: ResolutionFailed |
| 99 | + status: "False" |
| 100 | + type: Resolved |
| 101 | + - lastTransitionTime: "2023-10-19T18:50:34Z" |
| 102 | + message: installation has not been attempted as resolution failed |
| 103 | + observedGeneration: 3 |
| 104 | + reason: InstallationStatusUnknown |
| 105 | + status: Unknown |
| 106 | + type: Installed |
| 107 | +---- |
0 commit comments