Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions 03_build_installer.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env bash
set -x
set -e
set -euxo pipefail

source logging.sh
source common.sh
Expand Down
3 changes: 1 addition & 2 deletions 05_create_install_config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env bash
set -x
set -e
set -euxo pipefail

source logging.sh
source common.sh
Expand Down
19 changes: 9 additions & 10 deletions 06_create_cluster.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env bash
set -x
set -e
set -euxo pipefail

source logging.sh
source common.sh
Expand All @@ -14,9 +13,9 @@ source validation.sh
early_deploy_validation

if [[ ! -z "$INSTALLER_PROXY" ]]; then
export HTTP_PROXY=${HTTP_PROXY}
export HTTPS_PROXY=${HTTPS_PROXY}
export NO_PROXY=${NO_PROXY}
export HTTP_PROXY=${HTTP_PROXY:-}
export HTTPS_PROXY=${HTTPS_PROXY:-}
export NO_PROXY=${NO_PROXY:-}
# Update libvirt firewalld policy to allow the VM to connect to the proxy
sudo firewall-cmd --policy=libvirt-to-host --add-port=$INSTALLER_PROXY_PORT/tcp
# Allow the bootstrap VM to talk directly to services on the bootstrap host
Expand Down Expand Up @@ -87,7 +86,7 @@ if [[ -n "${MIRROR_IMAGES}" && "${MIRROR_IMAGES,,}" != "false" ]]; then
-p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": true}]'
fi

if [[ -n "${APPLY_EXTRA_WORKERS}" ]]; then
if [[ -n "${APPLY_EXTRA_WORKERS:-}" ]]; then
if [[ ${NUM_EXTRA_WORKERS} -ne 0 && -s "${OCP_DIR}/extra_host_manifests.yaml" ]]; then
oc apply -f "${OCP_DIR}/extra_host_manifests.yaml"

Expand All @@ -108,7 +107,7 @@ if [[ ${NUM_EXTRA_WORKERS} -ne 0 && -d "${OCP_DIR}/extras" ]]; then
oc create secret generic extraworkers-secret --from-file="${OCP_DIR}/extras/" -n openshift-machine-api
fi

if [[ -n "${APPLY_ARM_WORKERS}" ]]; then
if [[ -n "${APPLY_ARM_WORKERS:-}" ]]; then
if [[ ${NUM_ARM_WORKERS} -ne 0 && -s "${OCP_DIR}/extra_arm_host_manifests.yaml" ]]; then
oc apply -f "${OCP_DIR}/extra_arm_host_manifests.yaml"

Expand All @@ -129,9 +128,9 @@ if [[ ${NUM_ARM_WORKERS} -ne 0 && -d "${OCP_DIR}/arm" ]]; then
oc create secret generic armworkers-secret --from-file="${OCP_DIR}/arm/" -n openshift-machine-api
fi

if [[ ! -z "${ENABLE_METALLB}" ]]; then
if [[ ! -z "${ENABLE_METALLB:-}" ]]; then

if [[ -z ${METALLB_IMAGE_BASE} ]]; then
if [[ -z ${METALLB_IMAGE_BASE:-} ]]; then
# This can use any image in the release, as we are dropping
# the hash
export METALLB_IMAGE_BASE=$(\
Expand All @@ -145,7 +144,7 @@ if [[ ! -z "${ENABLE_METALLB}" ]]; then
popd
fi

if [[ ! -z "${ENABLE_VIRTUAL_MEDIA_VIA_EXTERNAL_NETWORK}" ]]; then
if [[ ! -z "${ENABLE_VIRTUAL_MEDIA_VIA_EXTERNAL_NETWORK:-}" ]]; then
oc patch provisioning provisioning-configuration --type merge -p "{\"spec\":{\"virtualMediaViaExternalNetwork\":true}}"
fi

Expand Down
18 changes: 9 additions & 9 deletions ocp_install_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ EOF
}

function external_mac() {
if [ -n "$EXTERNAL_BOOTSTRAP_MAC" ] ; then
if [ -n "${EXTERNAL_BOOTSTRAP_MAC:-}" ] ; then
cat <<EOF
externalMACAddress: $EXTERNAL_BOOTSTRAP_MAC
EOF
Expand Down Expand Up @@ -196,15 +196,15 @@ EOF
}

function featureSet() {
if [[ -n "$FEATURE_SET" ]]; then
if [[ -n "${FEATURE_SET:-}" ]]; then
cat <<EOF
featureSet: "$FEATURE_SET"
EOF
fi
}

function featureGates() {
if [[ -n "$FEATURE_GATES" ]]; then
if [[ -n "${FEATURE_GATES:-}" ]]; then
cat <<EOF
featureGates:
EOF
Expand All @@ -217,22 +217,22 @@ EOF
}

function osImageStream() {
if [[ -n "$OS_IMAGE_STREAM" ]]; then
if [[ -n "${OS_IMAGE_STREAM:-}" ]]; then
cat <<EOF
osImageStream: "$OS_IMAGE_STREAM"
EOF
fi
}

function capabilities_stanza() {
if [[ -n "$BASELINE_CAPABILITY_SET" ]]; then
if [[ -n "${BASELINE_CAPABILITY_SET:-}" ]]; then
cat <<EOF
capabilities:
baselineCapabilitySet: "$BASELINE_CAPABILITY_SET"
EOF
fi

if [[ -n "$BASELINE_CAPABILITY_SET" ]] && [[ -n "$ADDITIONAL_CAPABILITIES" ]]; then
if [[ -n "${BASELINE_CAPABILITY_SET:-}" ]] && [[ -n "${ADDITIONAL_CAPABILITIES:-}" ]]; then
cat << EOF
additionalEnabledCapabilities:
EOF
Expand All @@ -243,7 +243,7 @@ cat << EOF
EOF
done

elif [[ -n "$ADDITIONAL_CAPABILITIES" ]] && [[ -z "$BASELINE_CAPABILITY_SET" ]]; then
elif [[ -n "${ADDITIONAL_CAPABILITIES:-}" ]] && [[ -z "${BASELINE_CAPABILITY_SET:-}" ]]; then
echo "Additional capabilities is set to: $ADDITIONAL_CAPABILITIES, but no desired BASELINE_CAPABILITY_SET is set"
exit 1
fi
Expand All @@ -264,7 +264,7 @@ EOF
}

function workload_partitioning() {
if [[ -n "${ENABLE_WORKLOAD_PARTITIONING}" ]]; then
if [[ -n "${ENABLE_WORKLOAD_PARTITIONING:-}" ]]; then
cat <<EOF
cpuPartitioningMode: AllNodes
EOF
Expand All @@ -280,7 +280,7 @@ EOF
}

function additional_trust_bundle() {
if [[ ! -z "$ADDITIONAL_TRUST_BUNDLE" ]]; then
if [[ ! -z "${ADDITIONAL_TRUST_BUNDLE:-}" ]]; then
if [[ -z "${MIRROR_IMAGES}" || "${MIRROR_IMAGES,,}" != "false" ]] && [[ -z "${ENABLE_LOCAL_REGISTRY}" ]]; then
echo "additionalTrustBundle: |"
fi
Expand Down
8 changes: 4 additions & 4 deletions utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ function configure_chronyd() {
function custom_ntp(){
ASSESTS_DIR=$1
# TODO - consider adding NTP server config to install-config.yaml instead
if [ -z "${NTP_SERVERS}" ]; then
if [ -z "${NTP_SERVERS:-}" ]; then
if host clock.redhat.com; then
NTP_SERVERS="clock.redhat.com"
elif host pool.ntp.org; then
NTP_SERVERS="pool.ntp.org"
fi
fi

if [ -n "$NTP_SERVERS" ]; then
if [ -n "${NTP_SERVERS:-}" ]; then
cp assets/templates/98_worker-chronyd-custom.yaml.optional assets/generated/98_worker-chronyd-custom.yaml
cp assets/templates/98_master-chronyd-custom.yaml.optional assets/generated/98_master-chronyd-custom.yaml
NTPFILECONTENT=$(cat assets/files/etc/chrony.conf)
Expand Down Expand Up @@ -125,13 +125,13 @@ function create_cluster() {
mkdir -p ${assets_dir}/openshift
generate_assets

if [ -z "${NTP_SERVERS}" ];
if [ -z "${NTP_SERVERS:-}" ];
then
export NTP_SERVERS="$PROVISIONING_HOST_EXTERNAL_IP"
fi
custom_ntp ${assets_dir}/openshift

if [[ "${OVN_LOCAL_GATEWAY_MODE}" == "true" ]] && [[ "${NETWORK_TYPE}" == "OVNKubernetes" ]]; then
if [[ "${OVN_LOCAL_GATEWAY_MODE:-}" == "true" ]] && [[ "${NETWORK_TYPE}" == "OVNKubernetes" ]]; then
local_gateway_mode ${assets_dir}/openshift
fi
generate_metal3_config
Expand Down