// Module included in the following assemblies:
//
// * installing/disconnected_install/installing-mirroring-disconnected.adoc
// * updating/updating_a_cluster/updating_disconnected_cluster/mirroring-image-repository.adoc
// * microshift_running_apps/microshift_operators/microshift-operators-oc-mirror.com

:_mod-docs-content-type: REFERENCE
[id="oc-mirror-imageset-config-params_{context}"]
= Image set configuration parameters

[role="_abstract"]
The oc-mirror plugin requires an image set configuration file that defines what images to mirror.

The following table lists the available parameters for the `ImageSetConfiguration` resource.

.`ImageSetConfiguration` parameters
[cols="2,2a,1a",options="header"]
|===
|Parameter
|Description
|Values

|`apiVersion`
|The API version for the `ImageSetConfiguration` content.
|String. For example: `mirror.openshift.io/v1alpha2`.

ifndef::microshift[]
|`archiveSize`
|The maximum size, in GiB, of each archive file within the image set.
|Integer. For example: `4`
endif::microshift[]

|`mirror`
|The configuration of the image set.
|Object

|`mirror.additionalImages`
|The additional images configuration of the image set.
|Array of objects. For example:

[source,yaml]
----
additionalImages:
  - name: registry.redhat.io/ubi8/ubi:latest
----

|`mirror.additionalImages.name`
|The tag or digest of the image to mirror.
|String. For example: `registry.redhat.io/ubi8/ubi:latest`

|`mirror.blockedImages`
|The full tag, digest, or pattern of images to block from mirroring.
|Array of strings. For example: `docker.io/library/alpine`

ifndef::microshift[]
|`mirror.helm`
|The helm configuration of the image set. Note that the oc-mirror plugin supports only helm charts that do not require user input when rendered.
|Object

|`mirror.helm.local`
|The local helm charts to mirror.
|Array of objects. For example:

[source,yaml]
----
local:
  - name: podinfo
    path: /test/podinfo-5.0.0.tar.gz
----

|`mirror.helm.local.name`
|The name of the local helm chart to mirror.
|String. For example: `podinfo`.

|`mirror.helm.local.path`
|The path of the local helm chart to mirror.
|String. For example: `/test/podinfo-5.0.0.tar.gz`.

|`mirror.helm.repositories`
|The remote helm repositories to mirror from.
|Array of objects. For example:

[source,yaml]
----
repositories:
  - name: podinfo
    url: https://example.github.io/podinfo
    charts:
      - name: podinfo
        version: 5.0.0
----

|`mirror.helm.repositories.name`
|The name of the helm repository to mirror from.
|String. For example: `podinfo`.

|`mirror.helm.repositories.url`
|The URL of the helm repository to mirror from.
|String. For example: [x-]`https://example.github.io/podinfo`.

|`mirror.helm.repositories.charts`
|The remote helm charts to mirror.
|Array of objects.

|`mirror.helm.repositories.charts.name`
|The name of the helm chart to mirror.
|String. For example: `podinfo`.

|`mirror.helm.repositories.charts.version`
|The version of the named helm chart to mirror.
|String. For example: `5.0.0`.
endif::microshift[]

|`mirror.operators`
|The Operators configuration of the image set.
|Array of objects. For example:

[source,yaml,subs="attributes+"]
----
operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v{product-version}
    packages:
      - name: elasticsearch-operator
        minVersion: '2.4.0'
----

|`mirror.operators.catalog`
|The Operator catalog to include in the image set.
|String. For example: `registry.redhat.io/redhat/redhat-operator-index:v{product-version}`.

|`mirror.operators.full`
|When `true`, downloads the full catalog, Operator package, or Operator channel.
|Boolean. The default value is `false`.

|`mirror.operators.packages`
|The Operator packages configuration.
|Array of objects. For example:

[source,yaml,subs="attributes+"]
----
operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v{product-version}
    packages:
      - name: elasticsearch-operator
        minVersion: '5.2.3-31'
----

|`mirror.operators.packages.name`
|The Operator package name to include in the image set
|String. For example: `elasticsearch-operator`.

|`mirror.operators.packages.channels`
|The Operator package channel configuration.
|Object

|`mirror.operators.packages.channels.name`
|The Operator channel name, unique within a package, to include in the image set.
|String. For example: `fast` or `stable-v{product-version}`.

|`mirror.operators.packages.channels.maxVersion`
|The highest version of the Operator mirror across all channels in which it exists. See the following note for further information.
|String. For example: `5.2.3-31`

|`mirror.operators.packages.channels.minBundle`
|The name of the minimum bundle to include, plus all bundles in the update graph to the channel head. Set this field only if the named bundle has no semantic version metadata.
|String. For example: `bundleName`

|`mirror.operators.packages.channels.minVersion`
|The lowest version of the Operator to mirror across all channels in which it exists. See the following note for further information.
|String. For example: `5.2.3-31`

|`mirror.operators.packages.maxVersion`
|The highest version of the Operator to mirror across all channels in which it exists. See the following note for further information.
|String. For example: `5.2.3-31`.

|`mirror.operators.packages.minVersion`
|The lowest version of the Operator to mirror across all channels in which it exists. See the following note for further information.
|String. For example: `5.2.3-31`.

|`mirror.operators.skipDependencies`
|If `true`, dependencies of bundles are not included.
|Boolean. The default value is `false`.

|`mirror.operators.targetCatalog`
|An alternative name and optional namespace hierarchy to mirror the referenced catalog as.
|String. For example: `my-namespace/my-operator-catalog`

|`mirror.operators.targetName`
|An alternative name to mirror the referenced catalog as.

The `targetName` parameter is deprecated. Use the `targetCatalog` parameter instead.

|String. For example: `my-operator-catalog`

|`mirror.operators.targetTag`
|An alternative tag to append to the `targetName` or `targetCatalog`.
|String. For example: `v1`

ifndef::microshift[]
|`mirror.platform`
|The platform configuration of the image set.
|Object

|`mirror.platform.architectures`
|The architecture of the platform release payload to mirror.
|Array of strings. For example:

[source,yaml]
----
architectures:
  - amd64
  - arm64
  - multi
  - ppc64le
  - s390x
----

The default value is `amd64`. The value `multi` ensures that the mirroring is supported for all available architectures, eliminating the need to specify individual architectures.

|`mirror.platform.channels`
|The platform channel configuration of the image set.
|Array of objects. For example:

[source,yaml,subs="attributes+"]
----
channels:
  - name: stable-4.10
  - name: stable-{product-version}
----

|`mirror.platform.channels.full`
|When `true`, sets the `minVersion` to the first release in the channel and the `maxVersion` to the last release in the channel.
|Boolean. The default value is `false`.

|`mirror.platform.channels.name`
|The name of the release channel.
|String. For example: `stable-{product-version}`

|`mirror.platform.channels.minVersion`
|The minimum version of the referenced platform to be mirrored.
|String. For example: `4.12.6`

|`mirror.platform.channels.maxVersion`
|The highest version of the referenced platform to be mirrored.
|String. For example: `{product-version}.1`

|`mirror.platform.channels.shortestPath`
|Toggles shortest path mirroring or full range mirroring.
|Boolean. The default value is `false`.

|`mirror.platform.channels.type`
|The type of the platform to be mirrored.
|String. For example: `ocp` or `okd`. The default is `ocp`.

|`mirror.platform.graph`
|Indicates whether the OSUS graph is added to the image set and subsequently published to the mirror.
|Boolean. The default value is `false`.
endif::microshift[]

|`storageConfig`
|The back-end configuration of the image set.
|Object

|`storageConfig.local`
|The local back-end configuration of the image set.
|Object

|`storageConfig.local.path`
|The path of the directory to contain the image set metadata.
|String. For example: `./path/to/dir/`.

|`storageConfig.registry`
|The registry back-end configuration of the image set.
|Object

|`storageConfig.registry.imageURL`
|The back-end registry URI. Can optionally include a namespace reference in the URI.
|String. For example: `quay.io/myuser/imageset:metadata`.

|`storageConfig.registry.skipTLS`
|Optionally skip TLS verification of the referenced back-end registry.
|Boolean. The default value is `false`.

|===

[NOTE]
====
Using the `minVersion` and `maxVersion` properties to filter for a specific Operator version range can result in a multiple channel heads error. The error message states that there are `multiple channel heads`. This is because when the filter is applied, the update graph of the Operator is truncated.

Operator Lifecycle Manager requires that every Operator channel contains versions that form an update graph with exactly one end point, that is, the latest version of the Operator. When the filter range is applied, that graph can turn into two or more separate graphs or a graph that has more than one end point.

To avoid this error, do not filter out the latest version of an Operator. If you still run into the error, depending on the Operator, either the `maxVersion` property must be increased or the `minVersion` property must be decreased. Because every Operator graph can be different, you might need to adjust these values until the error resolves.
====
