Skip to content

Commit 1d849a9

Browse files
authored
Merge pull request #22625 from adellape/filter-by-os
Add --filter-by-os for catalog build + mirror
2 parents 8d45bf0 + 9e2720b commit 1d849a9

7 files changed

+104
-57
lines changed

modules/olm-arch-os-support.adoc

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * operators/operator_sdk/osdk-generating-csvs.adoc
4+
5+
[id="olm-arch-os-support_{context}"]
6+
= Architecture and operating system support for Operators
7+
8+
The following strings are supported in Operator Lifecycle Manager (OLM) on
9+
{product-title} when labeling or filtering Operators that support multiple
10+
architectures and operating systems:
11+
12+
.Architectures supported on {product-title}
13+
[options="header"]
14+
|===
15+
|Architecture |String
16+
17+
|AMD64
18+
|`amd64`
19+
20+
|64-bit PowerPC little-endian
21+
|`ppc64le`
22+
23+
|IBM Z
24+
|`s390x`
25+
|===
26+
27+
.Operating systems supported on {product-title}
28+
[options="header"]
29+
|===
30+
|Operating system |String
31+
32+
|Linux
33+
|`linux`
34+
35+
|z/OS
36+
|`zos`
37+
|===
38+
39+
[NOTE]
40+
====
41+
Different versions of {product-title} and other Kubernetes-based distributions
42+
might support a different set of architectures and operating systems.
43+
====

modules/olm-building-operator-catalog-image.adoc

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,26 @@ link:https://quay.io/[quay.io], tagging and pushing it to your mirror registry:
6969
----
7070
$ oc adm catalog build \
7171
--appregistry-org redhat-operators \//<1>
72-
--from=registry.redhat.io/openshift4/ose-operator-registry:v4.3 \//<2>
73-
--to=<registry_host_name>:<port>/olm/redhat-operators:v1 \//<3>
74-
[-a ${REG_CREDS}] \//<4>
75-
[--insecure] <5>
72+
--from=registry.redhat.io/openshift4/ose-operator-registry:v4.4 \//<2>
73+
--filter-by-os="linux/amd64" \//<3>
74+
--to=<registry_host_name>:<port>/olm/redhat-operators:v1 \//<4>
75+
[-a ${REG_CREDS}] \//<5>
76+
[--insecure] <6>
7677
7778
INFO[0013] loading Bundles dir=/var/folders/st/9cskxqs53ll3wdn434vw4cd80000gn/T/300666084/manifests-829192605
7879
...
7980
Pushed sha256:f73d42950021f9240389f99ddc5b0c7f1b533c054ba344654ff1edaf6bf827e3 to example_registry:5000/olm/redhat-operators:v1
8081
----
8182
<1> Organization (namespace) to pull from an App Registry instance.
82-
<2> Set `--from` to the `ose-operator-registry` base image using the tag that matches the target {product-title} cluster major and minor version.
83-
<3> Name your catalog image and include a tag, for example, `v1`.
84-
<4> Optional: If required, specify the location of your registry credentials file.
85-
<5> Optional: If you do not want to configure trust for the target registry, add the `--insecure` flag.
83+
<2> Set `--from` to the `ose-operator-registry` base image using the tag that
84+
matches the target {product-title} cluster major and minor version.
85+
<3> Set `--filter-by-os` to the operating system and architecture to use for the
86+
base image, which must match the target {product-title} cluster. Valid values
87+
are `linux/amd64`, `linux/ppc64le`, and `linux/s390x`.
88+
<4> Name your catalog image and include a tag, for example, `v1`.
89+
<5> Optional: If required, specify the location of your registry credentials file.
90+
<6> Optional: If you do not want to configure trust for the target registry, add the
91+
`--insecure` flag.
8692
+
8793
Sometimes invalid manifests are accidentally introduced into Red Hat's catalogs;
8894
when this happens, you might see some errors:

modules/olm-enabling-operator-for-multi-arch.adoc

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -32,41 +32,8 @@ additional architecture for an Operator in the non-default channel is possible,
3232
but that architecture is not available for filtering in the PackageManifest API.
3333
====
3434

35-
.Architectures supported on {product-title}
36-
[options="header"]
37-
|===
38-
|Architecture |String
39-
40-
|AMD64
41-
|`amd64`
42-
43-
|64-bit PowerPC little-endian
44-
|`ppc64le`
45-
46-
|IBM Z
47-
|`s390x`
48-
|===
49-
50-
.Operating systems supported on {product-title}
51-
[options="header"]
52-
|===
53-
|Operating system |String
54-
55-
|Linux
56-
|`linux`
57-
58-
|z/OS
59-
|`zos`
60-
|===
61-
62-
[NOTE]
63-
====
64-
Different versions of {product-title} and other Kubernetes-based distributions might
65-
support a different set of architectures and operating systems.
66-
====
67-
6835
If a CSV does not include an `os` label, it is treated as if it has the
69-
following by default:
36+
following Linux support label by default:
7037

7138
[source,yaml]
7239
----
@@ -75,7 +42,7 @@ labels:
7542
----
7643

7744
If a CSV does not include an `arch` label, it is treated as if it has the
78-
following by default:
45+
following AMD64 support label by default:
7946

8047
[source,yaml]
8148
----

modules/olm-restricted-networks-configuring-operatorhub.adoc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,20 @@ $ oc adm catalog mirror \
5454
<registry_host_name>:<port>/olm/redhat-operators:v1 \//<1>
5555
<registry_host_name>:<port> \
5656
[-a ${REG_CREDS}] \//<2>
57-
[--insecure] <3>
57+
[--insecure] \//<3>
58+
[--filter-by-os="<os>/<arch>"] <4>
5859
5960
mirroring ...
6061
----
6162
<1> Specify your Operator catalog image.
62-
<2> Optional: If required, specify the location of your registry credentials file.
63-
<3> Optional: If you do not want to configure trust for the target registry, add the `--insecure` flag.
63+
<2> Optional: If required, specify the location of your registry credentials
64+
file.
65+
<3> Optional: If you do not want to configure trust for the target registry, add
66+
the `--insecure` flag.
67+
<4> Optional: Because the catalog might reference images that support multiple
68+
architectures and operating systems, you can filter by architecture and
69+
operating system to mirror only the images that match. Valid values are
70+
`linux/amd64`, `linux/ppc64le`, and `linux/s390x`.
6471
+
6572
This command also creates a `<image_name>-manifests/` directory in the current
6673
directory and generates the following files:

modules/olm-updating-operator-catalog-image.adoc

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,27 @@ link:https://quay.io/[quay.io], tagging and pushing it to your mirror registry:
5656
----
5757
$ oc adm catalog build \
5858
--appregistry-org redhat-operators \//<1>
59-
--from=registry.redhat.io/openshift4/ose-operator-registry:v4.3 \//<2>
60-
--to=<registry_host_name>:<port>/olm/redhat-operators:v2 \//<3>
61-
[-a ${REG_CREDS}] \//<4>
62-
[--insecure] <5>
59+
--from=registry.redhat.io/openshift4/ose-operator-registry:v4.4 \//<2>
60+
--filter-by-os="linux/amd64" \//<3>
61+
--to=<registry_host_name>:<port>/olm/redhat-operators:v2 \//<4>
62+
[-a ${REG_CREDS}] \//<5>
63+
[--insecure] <6>
6364
6465
INFO[0013] loading Bundles dir=/var/folders/st/9cskxqs53ll3wdn434vw4cd80000gn/T/300666084/manifests-829192605
6566
...
6667
Pushed sha256:f73d42950021f9240389f99ddc5b0c7f1b533c054ba344654ff1edaf6bf827e3 to example_registry:5000/olm/redhat-operators:v2
6768
----
6869
<1> Organization (namespace) to pull from an App Registry instance.
69-
<2> Set `--from` to the `ose-operator-registry` base image using the tag that matches the target {product-title} cluster major and minor version.
70-
<3> Name your catalog image and include a tag, for example, `v2` because it is the updated catalog.
71-
<4> Optional: If required, specify the location of your registry credentials file.
72-
<5> Optional: If you do not want to configure trust for the target registry, add the `--insecure` flag.
70+
<2> Set `--from` to the `ose-operator-registry` base image using the tag that
71+
matches the target {product-title} cluster major and minor version.
72+
<3> Set `--filter-by-os` to the operating system and architecture to use for the
73+
base image, which must match the target {product-title} cluster. Valid values
74+
are `linux/amd64`, `linux/ppc64le`, and `linux/s390x`.
75+
<4> Name your catalog image and include a tag, for example, `v2` because it is the
76+
updated catalog.
77+
<5> Optional: If required, specify the location of your registry credentials file.
78+
<6> Optional: If you do not want to configure trust for the target registry, add the
79+
`--insecure` flag.
7380

7481
. Mirror the contents of your catalog to your target registry. The following
7582
`oc adm catalog mirror` command extracts the contents of your custom Operator
@@ -81,13 +88,20 @@ $ oc adm catalog mirror \
8188
<registry_host_name>:<port>/olm/redhat-operators:v2 \//<1>
8289
<registry_host_name>:<port> \
8390
[-a ${REG_CREDS}] \//<2>
84-
[--insecure] <3>
91+
[--insecure] \//<3>
92+
[--filter-by-os="<os>/<arch>"] <4>
8593
8694
mirroring ...
8795
----
8896
<1> Specify your new Operator catalog image.
89-
<2> Optional: If required, specify the location of your registry credentials file.
90-
<3> Optional: If you do not want to configure trust for the target registry, add the `--insecure` flag.
97+
<2> Optional: If required, specify the location of your registry credentials
98+
file.
99+
<3> Optional: If you do not want to configure trust for the target registry, add
100+
the `--insecure` flag.
101+
<4> Optional: Because the catalog might reference images that support multiple
102+
architectures and operating systems, you can filter by architecture and
103+
operating system to mirror only the images that match. Valid values are
104+
`linux/amd64`, `linux/ppc64le`, and `linux/s390x`.
91105

92106
. Apply the newly generated manifests:
93107
+

operators/olm-restricted-networks.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,13 @@ include::modules/olm-building-operator-catalog-image.adoc[leveloffset=+1]
4040
* xref:../installing/install_config/installing-restricted-networks-preparations.adoc#installing-restricted-networks-preparations[Creating a mirror registry for installation in a restricted network]
4141

4242
include::modules/olm-restricted-networks-configuring-operatorhub.adoc[leveloffset=+1]
43+
.Additional resources
44+
45+
* xref:../operators/operator_sdk/osdk-generating-csvs.adoc#olm-arch-os-support_osdk-generating-csvs[Architecture and operating system support for Operators]
46+
4347
include::modules/olm-updating-operator-catalog-image.adoc[leveloffset=+1]
48+
.Additional resources
49+
50+
* xref:../operators/operator_sdk/osdk-generating-csvs.adoc#olm-arch-os-support_osdk-generating-csvs[Architecture and operating system support for Operators]
51+
4452
include::modules/olm-testing-operator-catalog-image.adoc[leveloffset=+1]

operators/operator_sdk/osdk-generating-csvs.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ include::modules/olm-enabling-operator-for-multi-arch.adoc[leveloffset=+1]
5454
- See the link:https://docs.docker.com/registry/spec/manifest-v2-2/#manifest-list[Image Manifest V 2, Schema 2]
5555
specification for more information on manifest lists.
5656

57+
include::modules/olm-arch-os-support.adoc[leveloffset=+2]
58+
5759
include::modules/osdk-suggested-namespace.adoc[leveloffset=+1]
5860
include::modules/osdk-crds.adoc[leveloffset=+1]
5961
include::modules/osdk-owned-crds.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)