Skip to content

OLM 1.0 OCP 4.15 clean up tasks #71400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/olmv1-adding-a-catalog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ spec:
image:
ref: registry.redhat.io/redhat/redhat-operator-index:v{product-version} <1>
pullSecret: <pull_secret_name> <2>
pollInterval: <poll_interval_duration> <3>
----
<1> Specify the catalog's image in the `spec.source.image` field.
<2> If your catalog is hosted on a secure registry, such as `registry.redhat.io`, you must create a pull secret scoped to the `openshift-catalog` namespace.
<3> Specify the interval for polling the remote registry for newer image digests. The default value is `24h`. Valid units include seconds (`s`), minutes (`m`), and and hours (`h`). To disable polling, set a zero value, such as `0s`.

. Add the catalog to your cluster by running the following command:
+
Expand Down
2 changes: 1 addition & 1 deletion modules/olmv1-catalog-queries.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ $ jq -s '.[] \| select( .schema == "olm.channel" ) \| \
a|
[source,terminal]
----
$ jq -s '.[] \| select( .package == "<package_name" ) \| \
$ jq -s '.[] \| select( .package == "<package_name>" ) \| \
select( .schema == "olm.channel" ) \| \
select( .name == "<channel_name>" ) \| \
.entries \| .[] \| .name' <catalog_name>.json
Expand Down
8 changes: 4 additions & 4 deletions modules/olmv1-deleting-an-operator.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ You can delete an Operator and its custom resource definitions (CRDs) by deletin
+
[source,terminal]
----
$ oc delete operator.operators.operatorframework.io quay-example
$ oc delete operator.operators.operatorframework.io <operator_name>
----
+
.Example output
[source,text]
----
operator.operators.operatorframework.io "quay-example" deleted
operator.operators.operatorframework.io "<operator_name>" deleted
----

.Verification
Expand All @@ -50,11 +50,11 @@ No resources found
+
[source,terminal]
----
$ oc get ns quay-operator-system
$ oc get ns <operator_name>-system
----
+
.Example output
[source,text]
----
Error from server (NotFound): namespaces "quay-operator-system" not found
Error from server (NotFound): namespaces "<operator_name>-system" not found
----
6 changes: 3 additions & 3 deletions modules/olmv1-installing-an-operator.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ $ jq -s '.[] | select( .schema == "olm.channel" ) | \
+
[source,terminal]
----
$ jq -s '.[] | select( .package == "<package_name" ) | \
$ jq -s '.[] | select( .package == "<package_name>" ) | \
select( .schema == "olm.channel" ) | \
select( .name == "<channel_name" ) | .entries | \
select( .name == "<channel_name>" ) | .entries | \
.[] | .name' /<path>/<catalog_name>.json
----
+
Expand Down Expand Up @@ -108,7 +108,7 @@ metadata:
spec:
packageName: openshift-pipelines-operator-rh
channel: <channel>
version: <version>
version: "<version>"
----
+
where:
Expand Down
4 changes: 4 additions & 0 deletions modules/olmv1-red-hat-catalogs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ spec:
image:
ref: registry.redhat.io/redhat/redhat-operator-index:v{product-version}
pullSecret: <pull_secret_name>
pollInterval: <poll_interval_duration> <1>
----
<1> Specify the interval for polling the remote registry for newer image digests. The default value is `24h`. Valid units include seconds (`s`), minutes (`m`), and hours (`h`). To disable polling, set a zero value, such as `0s`.

.Example Certified Operators catalog
[source,yaml,subs="attributes+"]
Expand All @@ -43,6 +45,7 @@ spec:
image:
ref: registry.redhat.io/redhat/certified-operator-index:v{product-version}
pullSecret: <pull_secret_name>
pollInterval: 24h
----

.Example Community Operators catalog
Expand All @@ -58,6 +61,7 @@ spec:
image:
ref: registry.redhat.io/redhat/community-operator-index:v{product-version}
pullSecret: <pull_secret_name>
pollInterval: 24h
----

The following command adds a catalog to your cluster:
Expand Down
55 changes: 52 additions & 3 deletions modules/olmv1-updating-an-operator.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ $ jq -s '.[] | select( .schema == "olm.channel" ) | \
+
[source,terminal]
----
$ jq -s '.[] | select( .package == "<package_name" ) | \
$ jq -s '.[] | select( .package == "<package_name>" ) | \
select( .schema == "olm.channel" ) | \
select( .name == "<channel_name" ) | .entries | \
select( .name == "<channel_name>" ) | .entries | \
.[] | .name' /<path>/<catalog_name>.json
----
+
Expand Down Expand Up @@ -144,7 +144,9 @@ status:
include::snippets/olmv1-version-range-cr-adomn.adoc[]
--

. Edit your CR to update the version to `1.12.1`, as shown in the following example:
. Edit your CR by using one of the following methods:

** If you want to pin your Operator or extension to specific version, such as `1.12.1`, edit your CR similar to the following example:
+
.Example `pipelines-operator.yaml` CR
[source,yaml]
Expand All @@ -159,6 +161,53 @@ spec:
----
<1> Update the version from `1.11.1` to `1.12.1`

** If you want to define a range of acceptable update versions, edit your CR similar to the following example:
+
.Example CR with a version range specified
[source,yaml]
----
apiVersion: operators.operatorframework.io/v1alpha1
kind: Operator
metadata:
name: pipelines-operator
spec:
packageName: openshift-pipelines-operator-rh
version: ">1.11.1, <1.13" <1>
----
<1> Specifies that the desired version range is greater than version `1.11.1` and less than `1.13`. For more information, see "Support for version ranges" and "Version comparison strings".

** If you want to update to the latest version that can be resolved from a channel, edit your CR similar to the following example:
+
.Example CR with a specified channel
[source,yaml]
----
apiVersion: operators.operatorframework.io/v1alpha1
kind: Operator
metadata:
name: pipelines-operator
spec:
packageName: openshift-pipelines-operator-rh
channel: pipelines-1.13 <1>
----
<1> Installs the latest release that can be resolved from the specified channel. Updates to the channel are automatically installed.

** If you want to specify a channel and version or version range, edit your CR similar to the following example:
+
.Example CR with a specified channel and version range
[source,yaml]
----
apiVersion: operators.operatorframework.io/v1alpha1
kind: Operator
metadata:
name: pipelines-operator
spec:
packageName: openshift-pipelines-operator-rh
channel: latest
Copy link
Contributor

@snarayan-redhat snarayan-redhat Feb 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this example might need a placeholder and a corresponding callout to highlight the field specifying the channel?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heard. I did a draft of the doc where I took that approach. But the goal here is to give an actual example from the RH Operators catalog. So, using a placeholder goes against the goal of showing a customer a working CR.

version: "<1.13"
----
+
For more information, see "Example custom resources (CRs) that specify a target version".

. Apply the update to the cluster by running the following command:
+
[source,terminal]
Expand Down
4 changes: 2 additions & 2 deletions modules/olmv1-version-range-comparisons.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[id="olmv1-version-range-comparisons_{context}"]
= 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. You can add another comparison string by including an `OR`, or double vertical bar (`||`), comparison operator between the 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.

.Basic comparisons
[options="header"]
Expand Down Expand Up @@ -46,7 +46,7 @@ metadata:
name: pipelines-operator
spec:
packageName: openshift-pipelines-operator-rh
version: >=1.11, <1.13
version: ">=1.11, <1.13"
----

You can use wildcard characters in all types of comparison strings. {olmv1} 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ include::modules/olmv1-installing-an-operator.adoc[leveloffset=+1]
* xref:../../operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc#olmv1-version-range-support_olmv1-installing-operator[Support for version ranges]

include::modules/olmv1-updating-an-operator.adoc[leveloffset=+1]

[role="_additional-resources"]
.Additional resources
* xref:../../operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc#olmv1-about-target-versions_olmv1-installing-operator[Example custom resources (CRs) that specify a target version]
* xref:../../operators/olm_v1/olmv1-installing-an-operator-from-a-catalog.adoc#olmv1-version-range-comparisons_olmv1-installing-operator[Version comparison strings]

include::modules/olmv1-semver-support.adoc[leveloffset=+2]

[role="_additional-resources"]
Expand Down