Skip to content

Commit

Permalink
Merge pull request #613 from IBM/revert-612-fk-misc
Browse files Browse the repository at this point in the history
Revert "Air-gapped installation issues"
  • Loading branch information
fketelaars authored Jan 5, 2024
2 parents b77a83c + fad3b8f commit 4373682
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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/
dest: /tmp/work/offline
remote_src: True
when: (cpd_airgap | default(False) | bool)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,6 @@
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"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- 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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
name: manta
spec:
repositoryDigestMirrors:
- mirrors:
- icr.io/cpopen
source: repo.getmanta.com/manta-ubi8-ibm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[registry]]
prefix = ""
location = "repo.getmanta.com/manta-ubi8-ibm"
mirror-by-digest-only = true

[[registry.mirror]]
location = "icr.io/cpopen"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
icsp_name: manta-mirror-config
31 changes: 8 additions & 23 deletions cp-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -595,18 +595,6 @@ 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
Expand Down Expand Up @@ -638,6 +626,13 @@ 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 \
Expand Down Expand Up @@ -894,22 +889,12 @@ if ! $INSIDE_CONTAINER;then
fi
fi

# If download action, save Deployer and olm-utils images
# If download action, save Deployer image
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
Expand Down

0 comments on commit 4373682

Please sign in to comment.