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

:_mod-docs-content-type: PROCEDURE
[id="oc-mirror-updating-cluster-manifests-v2_{context}"]
= Configuring your cluster to use the resources generated by oc-mirror plugin v2

After you have mirrored your image set to the mirror registry, you must apply the generated `ImageDigestMirrorSet` (IDMS), `ImageTagMirrorSet` (ITMS), `CatalogSource`, and `UpdateService` resources to the cluster.

[IMPORTANT]
====
In oc-mirror plugin v2, the IDMS and ITMS files cover the entire image set, unlike the `ImageContentSourcePolicy` (ICSP) files in oc-mirror plugin v1. Therefore, the IDMS and ITMS files contain all images of the set even if you only add new images during incremental mirroring.
====

.Prerequisites

* You have access to the cluster as a user with the `cluster-admin` role.

.Procedure

. Log in to the OpenShift CLI as a user with the `cluster-admin` role.

. Apply the YAML files from the results directory to the cluster by running the following command:
+
[source,terminal]
----
$ oc apply -f <path_to_oc_mirror_workspace>/working-dir/cluster-resources
----

. If you mirrored release images, apply the release image signatures to the cluster by running the following command:
+
[source,terminal]
----
$ oc apply -f working-dir/cluster-resources/signature-configmap.json 
----
+
[IMPORTANT]
====
If you are mirroring Operators instead of clusters, do not run the preceding command. Running the command results in an error because there are no release image signatures to apply.

Additionally, a YAML file is available in the same directory `working-dir/cluster-resources/`. You can use either the JSON or YAML format.
====

.Verification

. Verify that the `ImageDigestMirrorSet` resources are successfully installed by running the following command:
+
[source,terminal]
----
$ oc get imagedigestmirrorset
----
+
To view only the resources created by `oc-mirror`, run the following command:
+
[source,terminal]
----
$ oc get imagedigestmirrorset -o jsonpath='{.items[?(@.metadata.annotations.createdBy=="oc-mirror v2")].metadata.name}'
----

. Verify that the `ImageTagMirrorSet` resources are successfully installed by running the following command:
+
[source,terminal]
----
$ oc get imagetagmirrorset
----
+
To view only the resources created by `oc-mirror`, run the following command:
+
[source,terminal]
----
$ oc get imagetagmirrorset -o jsonpath='{.items[?(@.metadata.annotations.createdBy=="oc-mirror v2")].metadata.name}'
----

. Verify that the `CatalogSource` resources are successfully installed by running the following command:
+
[source,terminal]
----
$ oc get catalogsource -n openshift-marketplace
----
+
To view only the resources created by `oc-mirror`, run the following command:
+
[source,terminal]
----
$ oc get catalogsource -o jsonpath='{.items[?(@.metadata.annotations.createdBy=="oc-mirror v2")].metadata.name}'
----

. Verify that the `ClusterCatalog` resources are successfully installed by running the following command:
+
[source,terminal]
----
$ oc get clustercatalog
----
+
To view only the resources created by `oc-mirror`, run the following command:
+
[source,terminal]
----
$ oc get clustercatalog -o jsonpath='{.items[?(@.metadata.annotations.createdBy=="oc-mirror v2")].metadata.name}'
----