From 152546b49fcc017071fcecc06b15ecbc13873bf3 Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Wed, 3 Jul 2024 10:05:08 +0200 Subject: [PATCH] Add possibility to overwrite all variables by env var Some variables like LOG_FILE is hardcoded and can not be overwrite. This commit causes each of the variables to be overwritten. --- pkg/bundle/setup/clustersetup.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/bundle/setup/clustersetup.sh b/pkg/bundle/setup/clustersetup.sh index 0df803f0..7092f8ea 100644 --- a/pkg/bundle/setup/clustersetup.sh +++ b/pkg/bundle/setup/clustersetup.sh @@ -1,12 +1,12 @@ #!/bin/bash #CONST -export KUBECONFIG="/opt/kubeconfig" -LOG_PATH="/tmp" -LOG_FILE="$LOG_PATH/_RANDOM_SUFFIX_.log" -DNSMASQ_CONF="/etc/dnsmasq.d/crc-dnsmasq.conf" -CLUSTER_HEALTH_SLEEP=8 -CLUSTER_HEALTH_RETRIES=500 -STEPS_SLEEP_TIME=10 +KUBECONFIG="/opt/kubeconfig" +LOG_PATH="${LOG_PATH:-"/tmp"}" +LOG_FILE="${LOG_FILE:-"$LOG_PATH/_RANDOM_SUFFIX_.log"}" +DNSMASQ_CONF="${DNSMASQ_CONF:-"/etc/dnsmasq.d/crc-dnsmasq.conf"}" +CLUSTER_HEALTH_SLEEP="${CLUSTER_HEALTH_SLEEP:-8}" +CLUSTER_HEALTH_RETRIES="${CLUSTER_HEALTH_RETRIES:-500}" +STEPS_SLEEP_TIME="${STEPS_SLEEP_TIME:-10}" #REPLACED VARS IIP="${IIP:-"_IIP_"}" EIP="${EIP:-"_EIP_"}" @@ -14,7 +14,7 @@ PULL_SECRET="${PULL_SECRET:-"_PULL_SECRET_"}" PASS_DEVELOPER="${PASS_DEVELOPER:-"_PASS_DEVELOPER_"}" PASS_KUBEADMIN="${PASS_KUBEADMIN:-"_PASS_KUBEADMIN_"}" PASS_REDHAT="${PASS_REDHAT:-"_PASS_REDHAT_"}" -MAXIMUM_LOGIN_RETRY=500 +MAXIMUM_LOGIN_RETRY="${MAXIMUM_LOGIN_RETRY:-500}" pr_info() { echo "[INF] $1" | tee -a $LOG_FILE > /dev/null