Skip to content

Commit f928243

Browse files
committed
Add TEST_SW_RAID option
Add the ability to config software RAID for worker nodes. Signed-off-by: Guangwen Feng <[email protected]>
1 parent af56270 commit f928243

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

common.sh

+3
Original file line numberDiff line numberDiff line change
@@ -494,3 +494,6 @@ if [[ -n "$MIRROR_IMAGES" || -z "${IP_STACK:-}" || "$IP_STACK" = "v6" || "$IP_ST
494494
fi
495495

496496
export AGENT_TEST_CASES=${AGENT_TEST_CASES:-}
497+
498+
# Defaults the variable to disable testing software RAID
499+
export TEST_SW_RAID=${TEST_SW_RAID:-true}

config_example.sh

+4
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,10 @@ set -x
686686
# will be used as input to the installer.
687687
# export AGENT_USE_ZTP_MANIFESTS=false
688688

689+
# TEST_SW_RAID -
690+
# Enable testing of software RAID
691+
# export TEST_SW_RAID=true
692+
689693
# Uncomment and set the following value to "true" to disable the automated
690694
# deployment systemd services of the Agent based installation. This is
691695
# particularly useful for WebUI development.

utils.sh

+11
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ function create_cluster() {
108108
mkdir -p ${assets_dir}/openshift
109109
generate_assets
110110

111+
if [[ "$TEST_SW_RAID" == "true" ]] && [[ "$NUM_WORKERS" -gt 0 ]]; then
112+
for n in $(seq "$NUM_MASTERS" $(expr "$NUM_WORKERS" + "$NUM_MASTERS" - 1));
113+
do
114+
sed -i "/status/i \\
115+
raid: \n\
116+
softwareRAIDVolumes: \n\
117+
- level: \"1\" \
118+
" ${assets_dir}/openshift/99_openshift-cluster-api_hosts-$n.yaml
119+
done
120+
fi
121+
111122
if [ -z "${NTP_SERVERS}" ];
112123
then
113124
export NTP_SERVERS="$PROVISIONING_HOST_EXTERNAL_IP"

0 commit comments

Comments
 (0)