Skip to content

Commit 8b1d7f1

Browse files
authored
Merge pull request #1090 from IBM/sh-531
#1081 OLM_UTILS_IMAGE environment variable needed for other cpd-cli c…
2 parents 4b67748 + 4fdbd1e commit 8b1d7f1

10 files changed

Lines changed: 30 additions & 6 deletions

File tree

automation-roles/50-install-cloud-pak/cp4d/cp4d-apply-entitlement/tasks/cp4d-apply-single-entitlement.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
_p_command_description: Apply entitlement {{ _p_entitlement }}
1010
_p_command: "{{ _apply_entitlement_command }}"
1111
_p_command_log_file: "{{ status_dir }}/log/{{ current_cp4d_cluster.project }}-apply-entitlement.log"
12+
_p_command_environment:
13+
OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}"
1214
_p_cpd_cli_manage: True

automation-roles/50-install-cloud-pak/cp4d/cp4d-cartridge-install/tasks/cp4d-setup-mcg-secrets.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@
88
vars:
99
_p_command_description: Set up Multicloud Object Gateway (MCG) secrets for {{ _p_component }} in project {{ _p_current_cp4d_cluster.project }}, logs are in {{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-{{ _current_cp4d_cartridge.olm_utils_name }}-setup-mcg.log
1010
_p_command: "{{ _setup_mcg_command }}"
11+
_p_command_environment:
12+
OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}"
1113
_p_cpd_cli_manage: True

automation-roles/50-install-cloud-pak/cp4d/cp4d-case-save/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
_p_command_description: Download case files
1313
_p_command: "{{ _case_download_command }}"
1414
_p_command_log_file: "{{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-case-download.log"
15+
_p_command_environment:
16+
OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}"
1517
_p_cpd_cli_manage: True
1618

1719
- name: Remove {{ status_dir }}/work/offline to remove any previous CASE files

automation-roles/50-install-cloud-pak/cp4d/cp4d-cluster/tasks/openshift-prepare-project.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
_p_command_description: Generate authorize instance command for project {{ current_cp4d_cluster.project }}
5353
_p_command: "{{ _authorize_instance_command }}"
5454
_p_command_log_file: "{{ status_dir }}/log/{{ current_cp4d_cluster.project }}-authorize-instance.log"
55+
_p_command_environment:
56+
OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}"
5557
_p_cpd_cli_manage: True
5658

5759
- name: Generate setup instance topology command for project {{ current_cp4d_cluster.project }} for CP4D 5.0.0 and lower

automation-roles/50-install-cloud-pak/cp4d/cp4d-mirror-images/tasks/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@
184184
_p_command: "{{ _mirror_model_images }}"
185185
_p_command_log_file: "{{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-mirror-model-images.log"
186186
_p_command_failed_when: False
187+
_p_command_environment:
188+
OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}"
187189
_p_cpd_cli_manage: True
188190

189191
- set_fact:
@@ -206,6 +208,8 @@
206208
_p_command: "{{ _mirror_images }}"
207209
_p_command_log_file: "{{ status_dir }}/log/{{ _p_current_cp4d_cluster.project }}-mirror-images.log"
208210
_p_command_failed_when: False
211+
_p_command_environment:
212+
OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}"
209213
_p_cpd_cli_manage: True
210214

211215
- set_fact:

automation-roles/50-install-cloud-pak/cp4d/cp4d-scheduling-service/tasks/install-scheduler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@
2121
_p_command_description: Apply scheduler
2222
_p_command: "{{ _apply_scheduler_command }}"
2323
_p_command_log_file: "{{ status_dir }}/log/{{ current_cp4d_cluster.project }}-apply-scheduler.log"
24+
_p_command_environment:
25+
OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}"
2426
_p_cpd_cli_manage: True

automation-roles/50-install-cloud-pak/cp4d/cp4d-variables/tasks/get-cr-status.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
vars:
1414
_p_activity_description: "Get status of CRs for project {{ _p_current_cp4d_cluster.project }}"
1515
_p_activity_command: "{{ _get_cr_status_command }}"
16+
_p_command_environment:
17+
OLM_UTILS_IMAGE: "{{ _olm_utils_image_full }}"
1618
_p_cpd_cli_manage: True
1719

1820
- name: Run get-cr-status command

docker-scripts/env-command.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,8 @@ else
4848
echo "No existing OpenShift configuration found, you will need to login to OpenShift first."
4949
fi
5050

51-
OLM_UTILS_IMAGE_PREFIX=$(cat $(ls -1 /cloud-pak-deployer/.version-info/olm-utils-v*.txt | tail -1) | cut -d: -f1)
52-
OLM_UTILS_IMAGE_DIGEST=$(jq -r '.manifests[0].digest' $(ls -1 /cloud-pak-deployer/.version-info/olm-utils-v*manifest.json | tail -1))
53-
export OLM_UTILS_IMAGE="${OLM_UTILS_IMAGE_PREFIX}@${OLM_UTILS_IMAGE_DIGEST}"
54-
echo "Environment variable OLM_UTILS_IMAGE set to ${OLM_UTILS_IMAGE}"
55-
56-
echo
51+
# Set environment variables
52+
source ${SCRIPT_DIR}/../scripts/deployer/set-env-var.sh
5753

5854
export PATH=${PATH}:/cloud-pak-deployer
5955
cd /cloud-pak-deployer

docker-scripts/run_automation.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ cd ${SCRIPT_DIR}/..
2727
# Retrieve version info
2828
source ./.version-info/version-info.sh
2929

30+
# Set environment variables
31+
source ./scripts/deployer/set-env-var.sh
32+
3033
# Show login info
3134
show_deployer_info() {
3235
if [[ "$SUBCOMMAND" == "environment" && "${ACTION}" == "apply" ]];then
@@ -100,6 +103,7 @@ env|environment)
100103
run_cmd+=" --extra-vars cpd_accept_licenses=${CPD_ACCEPT_LICENSES}"
101104
run_cmd+=" --extra-vars ARCH=${ARCH}"
102105
run_cmd+=" --extra-vars IMAGE_ARCH=${IMAGE_ARCH}"
106+
run_cmd+=" --extra-vars OLM_UTILS_IMAGE=${OLM_UTILS_IMAGE}"
103107

104108
if [ ! -z $VAULT_PASSWORD ];then
105109
run_cmd+=" --extra-vars VAULT_PASSWORD=${VAULT_PASSWORD}"

scripts/deployer/set-env-var.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )
3+
4+
# Set OLM_UTILS_IMAGE environment variable, needed for most cpd-cli commands
5+
OLM_UTILS_IMAGE_PREFIX=$(cat $(ls -1 ${SCRIPT_DIR}/../../.version-info/olm-utils-v*.txt | tail -1) | cut -d: -f1)
6+
OLM_UTILS_IMAGE_DIGEST=$(jq -r '.manifests[0].digest' $(ls -1 ${SCRIPT_DIR}/../../.version-info/olm-utils-v*manifest.json | tail -1))
7+
export OLM_UTILS_IMAGE="${OLM_UTILS_IMAGE_PREFIX}@${OLM_UTILS_IMAGE_DIGEST}"
8+
echo "Environment variable OLM_UTILS_IMAGE set to ${OLM_UTILS_IMAGE}"

0 commit comments

Comments
 (0)