Skip to content

Commit eaec5fd

Browse files
author
Steven Smith
committed
Adds procedure for setting import mode when importing images
1 parent c9550a9 commit eaec5fd

9 files changed

+155
-15
lines changed

modules/images-getting-info-about-imagestreams.adoc

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can get general information about the image stream and detailed information
99

1010
.Procedure
1111

12-
* Get general information about the image stream and detailed information about all the tags it is pointing to:
12+
* To get general information about the image stream and detailed information about all the tags it is pointing to, enter the following command:
1313
+
1414
[source,terminal]
1515
----
@@ -43,7 +43,7 @@ Tags: 1
4343
About a minute ago
4444
----
4545
46-
* Get all the information available about particular image stream tag:
46+
* To get all of the information available about a particular image stream tag, enter the following command:
4747
+
4848
[source,terminal]
4949
----
@@ -75,8 +75,35 @@ User: 1001
7575
Exposes Ports: 8080/tcp
7676
Docker Labels: build-date=20170801
7777
----
78-
78+
+
7979
[NOTE]
8080
====
8181
More information is output than shown.
8282
====
83+
84+
* Enter the following command to discover which architecture or operating system that an image stream tag supports:
85+
+
86+
[source,terminal]
87+
----
88+
$ oc get istag <image-stream-tag> -ojsonpath="{range .image.dockerImageManifests[*]}{.os}/{.architecture}{'\n'}{end}"
89+
----
90+
+
91+
For example:
92+
+
93+
[source,terminal]
94+
----
95+
$ oc get istag busybox:latest -ojsonpath="{range .image.dockerImageManifests[*]}{.os}/{.architecture}{'\n'}{end}"
96+
----
97+
+
98+
.Example output
99+
[source,terminal]
100+
----
101+
linux/amd64
102+
linux/arm
103+
linux/arm64
104+
linux/386
105+
linux/mips64le
106+
linux/ppc64le
107+
linux/riscv64
108+
linux/s390x
109+
----
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+
// * openshift_images/image-streams-managing.adoc
3+
4+
:_content-type: PROCEDURE
5+
[id="images-imagestream-import-import-mode_{context}"]
6+
= Working with manifest lists
7+
8+
You can import a single sub-manifest, or all manifests, of a manifest list when using `oc import-image` or `oc tag` CLI commands by adding the `--import-mode` flag. Refer to the commands below to create an image stream that includes a single sub-manifest or multi-architecture images.
9+
10+
.Procedure
11+
12+
* Create an image stream that includes multi-architecture images, and sets the import mode to `PreserveOriginal`, by entering the following command:
13+
+
14+
[source,terminal]
15+
----
16+
$ oc import-image <multiarch-image-stream-tag> --from=<registry>/<project_name>/<image-name> \
17+
--import-mode='PreserveOriginal' --reference-policy=local --confirm
18+
----
19+
+
20+
.Example output
21+
+
22+
[source,terminal]
23+
----
24+
---
25+
Arch: <none>
26+
Manifests: linux/amd64 sha256:6e325b86566fafd3c4683a05a219c30c421fbccbf8d87ab9d20d4ec1131c3451
27+
linux/arm64 sha256:d8fad562ffa75b96212c4a6dc81faf327d67714ed85475bf642729703a2b5bf6
28+
linux/ppc64le sha256:7b7e25338e40d8bdeb1b28e37fef5e64f0afd412530b257f5b02b30851f416e1
29+
---
30+
----
31+
32+
* Alternatively, enter the following command to import an image with the `Legacy` import mode, which discards manifest lists and imports a single sub-manifest:
33+
+
34+
[source,terminal]
35+
----
36+
$ oc import-image <multiarch-image-stream-tag> --from=<registry>/<project_name>/<image-name> \
37+
--import-mode='Legacy' --confirm
38+
----
39+
+
40+
[NOTE]
41+
====
42+
The `--import-mode=` default value is `Legacy`. Excluding this value, or failing to specify either `Legacy` or `PreserveOriginal`, imports a single sub-manifest. An invalid import mode returns the following error: `error: valid ImportMode values are Legacy or PreserveOriginal`.
43+
====

modules/images-imagestream-import.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ This command causes {product-title} to periodically update this particular image
3636
[source,terminal]
3737
----
3838
$ oc tag <repositiory/image> <image-name:tag>
39-
----
39+
----
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Module included in the following assemblies:
2+
// * openshift_images/image-streams-managing.adoc
3+
4+
:_content-type: PROCEDURE
5+
[id="images-imagestream-periodic-import-list_{context}"]
6+
= Configuring periodic importing of manifest lists
7+
8+
To periodically re-import a manifest list, you can use the `--scheduled` flag.
9+
10+
.Procedure
11+
12+
* Set the image stream to periodically update the manifest list by entering the following command:
13+
+
14+
[source,terminal]
15+
----
16+
$ oc import-image <multiarch-image-stream-tag> --from=<registry>/<project_name>/<image-name> \
17+
--import-mode='PreserveOriginal' --scheduled=true
18+
----
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assemblies:
2+
// * assembly/openshift_images/managing-image-streams.adoc
3+
4+
:_content-type: CONCEPT
5+
[id="images-imagestream-specify-architecture_{context}"]
6+
= Specifying architecture for --import-mode
7+
8+
You can swap your imported image stream between multi-architecture and single architecture by excluding or including the `--import-mode=` flag
9+
10+
.Procedure
11+
12+
* Run the following command to update your image stream from multi-architecture to single architecture by excluding the `--import-mode=` flag:
13+
+
14+
[source,terminal]
15+
----
16+
$ oc import-image <multiarch-image-stream-tag> --from=<registry>/<project_name>/<image-name>
17+
----
18+
19+
* Run the following command to update your image stream from single-architecture to multi-architecture:
20+
+
21+
[source,terminal]
22+
----
23+
$ oc import-image <multiarch-image-stream-tag> --from=<registry>/<project_name>/<image-name> \
24+
--import-mode='PreserveOriginal'
25+
----
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Module included in the following assemblies:
2+
// * openshift_images/image-streams-managing.adoc
3+
4+
:_content-type: PROCEDURE
5+
[id="images-imagestream-ssl-import-list_{context}"]
6+
= Configuring SSL/TSL when importing manifest lists
7+
8+
To configure SSL/TSL when importing a manifest list, you can use the `--insecure` flag.
9+
10+
.Procedure
11+
12+
* Set `--insecure=true` so that importing a manifest list skips SSL/TSL verification. For example:
13+
+
14+
[source,terminal]
15+
----
16+
$ oc import-image <multiarch-image-stream-tag> --from=<registry>/<project_name>/<image-name> \
17+
--import-mode='PreserveOriginal' --insecure=true
18+
----

modules/importing-manifest-list-through-imagestreamimport.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
= Importing a manifest list through ImageStreamImport
77

88

9-
You can use the `ImageStreamImport` resource to find and import image manifests from other container image registries into the cluster. Individual images or an entire image repository can be imported.
9+
You can use the `ImageStreamImport` resource to find and import image manifests from other container image registries into the cluster. Individual images or an entire image repository can be imported.
1010

11-
Use the following procedure to import a manifest list through the `ImageStreamImport` object with the `importMode` value.
11+
Use the following procedure to import a manifest list through the `ImageStreamImport` object with the `importMode` value.
1212

1313
.Procedure
1414

@@ -26,7 +26,7 @@ spec:
2626
images:
2727
- from:
2828
kind: DockerImage
29-
name: <registry>/<user_name>/<image_name>
29+
name: <registry>/<project_name>/<image_name>
3030
to:
3131
name: latest
3232
referencePolicy:
@@ -35,7 +35,7 @@ spec:
3535
importMode: "PreserveOriginal"
3636
----
3737

38-
. Create the `ImageStreamImport` by running the following command:
38+
. Create the `ImageStreamImport` by running the following command:
3939
+
4040
[source,terminal]
4141
----

modules/importmode-configuration-fields.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33

44
:_content-type: CONCEPT
55
[id="importmode-configuration-fields_{context}"]
6-
= importMode configuration fields
6+
= Configuration fields for --import-mode
77

8-
The following table describes the configuration fields available for the `importMode` value:
8+
The following table describes the options available for the `--import-mode=` flag:
99

1010
[cols="3a,8a",options="header"]
1111
|===
1212
|Parameter |Description
1313

14-
| *Legacy* | The default value for `importMode`. When active, the manifest list is discarded, and a single sub-manifest is imported. The platform is chosen in the following order of priority:
14+
| *Legacy* | The default option for `--import-mode`. When specified, the manifest list is discarded, and a single sub-manifest is imported. The platform is chosen in the following order of priority:
1515

1616
. Tag annotations
1717
. Control plane architecture
1818
. Linux/AMD64
1919
. The first manifest in the list
2020

21-
| *PreserveOriginal* | When active, the original manifest is preserved. For manifest lists, the manifest list and all of its sub-manifests are imported.
21+
| *PreserveOriginal* | When specified, the original manifest is preserved. For manifest lists, the manifest list and all of its sub-manifests are imported.
2222

2323
|===

openshift_images/image-streams-manage.adoc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,17 @@ See xref:../openshift_images/configuring-samples-operator.adoc#images-samples-op
2929

3030
include::modules/images-imagestream-import.adoc[leveloffset=+2]
3131

32-
include::modules/images-imagestream-import-images-private-registry.adoc[leveloffset=+1]
33-
include::modules/images-allow-pods-to-reference-images-from-secure-registries.adoc[leveloffset=+2]
32+
[id="images-imagestream-import-images-image-streams"]
33+
== Importing and working with images and image streams
3434

35-
include::modules/importing-manifest-list-through-imagestreamimport.adoc[leveloffset=+1]
35+
The following sections describe how to import, and work with, image streams.
36+
37+
include::modules/images-imagestream-import-images-private-registry.adoc[leveloffset=+2]
38+
include::modules/images-allow-pods-to-reference-images-from-secure-registries.adoc[leveloffset=+3]
39+
40+
41+
include::modules/images-imagestream-import-import-mode.adoc[leveloffset=+2]
42+
include::modules/images-imagestream-periodic-import-list.adoc[leveloffset=+3]
43+
include::modules/images-imagestream-ssl-import-list.adoc[leveloffset=+3]
44+
include::modules/images-imagestream-specify-architecture.adoc[leveloffset=+2]
3645
include::modules/importmode-configuration-fields.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)