// Module included in the following assemblies:
//
// * updating/updating_a_cluster/updating_disconnected_cluster/mirroring-image-repository.adoc

:_mod-docs-content-type: REFERENCE
[id="oc-mirror-image-set-examples-add-images_{context}"]
= Mirror registry update examples

[role="_abstract"]
You can update mirror registry content by modifying the `ImageSetConfiguration` file to mirror a specific version, update Operators, or prune existing images.

This section covers the use cases for updating the mirror registry from disk to mirror.

.Example `ImageSetConfiguration` file that was previously used for mirroring

[source, yaml]
----
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  local:
    path: /home/user/metadata
mirror:
  platform:
    channels:
      - name: stable-4.12
        minVersion: 4.12.1
        maxVersion: 4.12.1
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
      packages:
        - name: rhacs-operator
          channels:
          - name: stable
----


== Mirroring a specific {product-title} version by pruning the existing images

.Updated `ImageSetConfiguration` file

[source,yaml]
----
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  local:
    path: /home/user/metadata
mirror:
  platform:
    channels:
      - name: stable-4.13
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
      packages:
        - name: rhacs-operator
          channels:
          - name: stable
----

Specifying `mirror.platform.channels.name` as `stable-4.13` prunes all the images of `stable-4.12`.


== Updating to the latest version of an Operator by pruning the existing images

.Updated `ImageSetConfiguration` file

[source,yaml,subs=attributes+]
----
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  local:
    path: /home/user/metadata
mirror:
  platform:
    channels:
      - name: stable-4.12
        minVersion: 4.12.1
        maxVersion: 4.12.1
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
      packages:
        - name: rhacs-operator
          channels:
          - name: stable
----

Using the same channel for `operators.packages.channels.name` without specifying a version prunes the existing images and updates with the latest version of images.



[id="oc-mirror-image-set-examples-operator-pruning-versions_{context}"]
== Mirroring a new Operator by pruning the existing Operator

.Updated `ImageSetConfiguration` file

[source,yaml,subs=attributes+]
----
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  local:
    path: /home/user/metadata
mirror:
  platform:
    channels:
      - name: stable-4.12
        minVersion: 4.12.1
        maxVersion: 4.12.1
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
      packages:
        - name: <new_operator_name>
          channels:
          - name: stable
----

Replacing `rhacs-operator` with `new_operator_name` prunes the Red Hat Advanced Cluster Security for Kubernetes Operator.


== Pruning all the {product-title} images

.Updated `ImageSetConfiguration` file

[source,yaml,subs=attributes+]
----
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
  local:
    path: /home/user/metadata
mirror:
  platform:
    channels:
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
      packages:
----