From 70251264f08264597484b017e3ed0e8c7f7ee18f Mon Sep 17 00:00:00 2001 From: Frank Ketelaars Date: Mon, 18 Dec 2023 07:07:48 +0000 Subject: [PATCH 1/3] #572 Delete obsolete manta ICSP --- .../cp4d-ocp-icsp-manta/tasks/create-icsp-manta.yml | 7 ------- .../cp4d/cp4d-ocp-icsp-manta/tasks/main.yml | 11 ----------- .../tasks/non-mco-apply-icsp-manta.yml | 10 ---------- .../templates/cloud-pak-icsp-manta.j2 | 9 --------- .../templates/cloud-pak-icsp-registries-manta-conf.j2 | 7 ------- .../cp4d/cp4d-ocp-icsp-manta/vars/main.yml | 2 -- 6 files changed, 46 deletions(-) delete mode 100644 automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/tasks/create-icsp-manta.yml delete mode 100644 automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/tasks/main.yml delete mode 100644 automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/tasks/non-mco-apply-icsp-manta.yml delete mode 100644 automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/templates/cloud-pak-icsp-manta.j2 delete mode 100644 automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/templates/cloud-pak-icsp-registries-manta-conf.j2 delete mode 100644 automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/vars/main.yml diff --git a/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/tasks/create-icsp-manta.yml b/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/tasks/create-icsp-manta.yml deleted file mode 100644 index c0bc96824..000000000 --- a/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/tasks/create-icsp-manta.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Create ImageContentSourcePolicy {{ icsp_name }} yaml - template: - src: cloud-pak-icsp-manta.j2 - dest: "{{ status_dir }}/openshift/cloud-pak-icsp-manta.yaml" -- name: Create ImageContentSourcePolicy {{ icsp_name }} - shell: "oc apply -f {{ status_dir }}/openshift/cloud-pak-icsp-manta.yaml" \ No newline at end of file diff --git a/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/tasks/main.yml b/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/tasks/main.yml deleted file mode 100644 index 0599d194e..000000000 --- a/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/tasks/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- debug: - var: _cartridges_to_install - -- name: Create ImageContentSourcePolicy for Manta - include_tasks: create-icsp-manta.yml - when: _mco_exists - -- name: Apply ImageContentSourcePolicy settings if the Machine Config Operator does not exist - include_tasks: non-mco-apply-icsp-manta.yml - when: not _mco_exists \ No newline at end of file diff --git a/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/tasks/non-mco-apply-icsp-manta.yml b/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/tasks/non-mco-apply-icsp-manta.yml deleted file mode 100644 index 3509d928a..000000000 --- a/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/tasks/non-mco-apply-icsp-manta.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: Create Manta registry configuration (ImageContentSourcePolicy) on ROKS - template: - src: cloud-pak-icsp-registries-manta-conf.j2 - dest: "{{ status_dir }}/openshift/cloud-pak-icsp-registries-manta.conf" - -- name: Set data for config map - shell: | - oc set data cm/cloud-pak-node-fix-config -n kube-system \ - --from-file={{ status_dir }}/openshift/cloud-pak-icsp-registries-manta.conf \ No newline at end of file diff --git a/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/templates/cloud-pak-icsp-manta.j2 b/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/templates/cloud-pak-icsp-manta.j2 deleted file mode 100644 index d031283ce..000000000 --- a/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/templates/cloud-pak-icsp-manta.j2 +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: operator.openshift.io/v1alpha1 -kind: ImageContentSourcePolicy -metadata: - name: manta -spec: - repositoryDigestMirrors: - - mirrors: - - icr.io/cpopen - source: repo.getmanta.com/manta-ubi8-ibm \ No newline at end of file diff --git a/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/templates/cloud-pak-icsp-registries-manta-conf.j2 b/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/templates/cloud-pak-icsp-registries-manta-conf.j2 deleted file mode 100644 index 76262cd94..000000000 --- a/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/templates/cloud-pak-icsp-registries-manta-conf.j2 +++ /dev/null @@ -1,7 +0,0 @@ -[[registry]] - prefix = "" - location = "repo.getmanta.com/manta-ubi8-ibm" - mirror-by-digest-only = true - - [[registry.mirror]] - location = "icr.io/cpopen" diff --git a/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/vars/main.yml b/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/vars/main.yml deleted file mode 100644 index ae73ceb7c..000000000 --- a/automation-roles/50-install-cloud-pak/cp4d/cp4d-ocp-icsp-manta/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -icsp_name: manta-mirror-config \ No newline at end of file From a72407123b75346767329e67b7c545802d49dac7 Mon Sep 17 00:00:00 2001 From: Frank Ketelaars Date: Fri, 29 Dec 2023 16:13:39 +0000 Subject: [PATCH 2/3] #610 redo --- .../tasks/create-catalog-source-olm-utils.yml | 2 +- .../cp4d/cp4d-mirror-images/tasks/main.yml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/automation-roles/50-install-cloud-pak/cp4d/cp4d-catalog-source/tasks/create-catalog-source-olm-utils.yml b/automation-roles/50-install-cloud-pak/cp4d/cp4d-catalog-source/tasks/create-catalog-source-olm-utils.yml index 4265500f4..f5243d062 100644 --- a/automation-roles/50-install-cloud-pak/cp4d/cp4d-catalog-source/tasks/create-catalog-source-olm-utils.yml +++ b/automation-roles/50-install-cloud-pak/cp4d/cp4d-catalog-source/tasks/create-catalog-source-olm-utils.yml @@ -21,7 +21,7 @@ - name: If air-gapped, copy case files from {{ status_dir }}/cp4d/offline to /tmp/work/offline copy: src: "{{ status_dir }}/cp4d/offline" - dest: /tmp/work/offline + dest: /tmp/work/ remote_src: True when: (cpd_airgap | default(False) | bool) diff --git a/automation-roles/50-install-cloud-pak/cp4d/cp4d-mirror-images/tasks/main.yml b/automation-roles/50-install-cloud-pak/cp4d/cp4d-mirror-images/tasks/main.yml index 4ef6c4198..56b1176b4 100644 --- a/automation-roles/50-install-cloud-pak/cp4d/cp4d-mirror-images/tasks/main.yml +++ b/automation-roles/50-install-cloud-pak/cp4d/cp4d-mirror-images/tasks/main.yml @@ -116,6 +116,12 @@ failed_when: False register: _mirror_images +- name: Copy case files from /tmp/work/offline to {{ status_dir }}/cp4d/ + copy: + src: /tmp/work/offline + dest: "{{ status_dir }}/cp4d/" + remote_src: True + - name: Stop script that mirrors log files file: path: "/tmp/mirroring-complete.txt" From 94bb5f07a371962ccc70c9c081606cbfe30b693e Mon Sep 17 00:00:00 2001 From: Frank Ketelaars Date: Mon, 1 Jan 2024 16:19:58 +0000 Subject: [PATCH 3/3] #609 Allow customer olm-utils images --- cp-deploy.sh | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/cp-deploy.sh b/cp-deploy.sh index 86909557c..172b332ef 100755 --- a/cp-deploy.sh +++ b/cp-deploy.sh @@ -595,6 +595,18 @@ if ! $INSIDE_CONTAINER;then fi fi +# If images have not been overridden, set the variables here +if [ -z $CPD_OLM_UTILS_V1_IMAGE ];then + export CPD_OLM_UTILS_V1_IMAGE=icr.io/cpopen/cpd/olm-utils:latest +else + echo "Custom olm-utils image ${CPD_OLM_UTILS_V1_IMAGE} will be used." +fi +if [ -z $CPD_OLM_UTILS_V2_IMAGE ];then + export CPD_OLM_UTILS_V2_IMAGE=icr.io/cpopen/cpd/olm-utils-v2:latest +else + echo "Custom olm-utils-v2 image ${CPD_OLM_UTILS_V2_IMAGE} will be used." +fi + if ! $INSIDE_CONTAINER;then # Check if podman or docker command was found if [ -z $CPD_CONTAINER_ENGINE ];then @@ -626,13 +638,6 @@ if ! $INSIDE_CONTAINER;then chmod +x ${SCRIPT_DIR}/.version-info/version-info.sh # Show version info cat ${SCRIPT_DIR}/.version-info/version-info.sh - # If images have not been overridden, set the variables here - if [ -z $CPD_OLM_UTILS_V1_IMAGE ];then - export CPD_OLM_UTILS_V1_IMAGE=icr.io/cpopen/cpd/olm-utils:latest - fi - if [ -z $CPD_OLM_UTILS_V2_IMAGE ];then - export CPD_OLM_UTILS_V2_IMAGE=icr.io/cpopen/cpd/olm-utils-v2:latest - fi # Build the image ${CPD_CONTAINER_ENGINE} build -t cloud-pak-deployer:${CPD_IMAGE_TAG} \ --pull \ @@ -889,12 +894,22 @@ if ! $INSIDE_CONTAINER;then fi fi -# If download action, save Deployer image +# If download action, save Deployer and olm-utils images if [[ "${ACTION}" == "download" ]] && ! ${CHECK_ONLY};then echo "Removing old archives for deployer container image" rm -f ${STATUS_DIR}/downloads/cloud-pak-deployer-image.tar echo "Saving Deployer container image cloud-pak-deployer:${CPD_IMAGE_TAG} into ${STATUS_DIR}/downloads/cloud-pak-deployer-image.tar" ${CPD_CONTAINER_ENGINE} save -o ${STATUS_DIR}/downloads/cloud-pak-deployer-image.tar cloud-pak-deployer:${CPD_IMAGE_TAG} + + echo "Removing old archives for olm-utils container image" + rm -f ${STATUS_DIR}/downloads/olm-utils-image.tar + echo "Saving container image ${CPD_OLM_UTILS_V1_IMAGE} into ${STATUS_DIR}/downloads/olm-utils-image.tar" + ${CPD_CONTAINER_ENGINE} save -o ${STATUS_DIR}/downloads/olm-utils-image.tar ${CPD_OLM_UTILS_V1_IMAGE} + + echo "Removing old archives for olm-utils-v2 container image" + rm -f ${STATUS_DIR}/downloads/olm-utils-v2-image.tar + echo "Saving container image ${CPD_OLM_UTILS_V2_IMAGE} into ${STATUS_DIR}/downloads/olm-utils-v2-image.tar" + ${CPD_CONTAINER_ENGINE} save -o ${STATUS_DIR}/downloads/olm-utils-v2-image.tar ${CPD_OLM_UTILS_V2_IMAGE} fi # Build command when not running inside container