Skip to content

Commit

Permalink
Merge pull request #1353 from Nordix/Write-bmhs-in-separated-files/mb…
Browse files Browse the repository at this point in the history
…oukhalfa

🌱 Write bmhs in separated files
  • Loading branch information
metal3-io-bot authored Feb 27, 2024
2 parents 5399872 + ad0a4a4 commit e8786b8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions 03_launch_mgmt_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,17 @@ EOF
# Create the BMH CRs
#
function make_bm_hosts() {
mkdir -p "${WORKING_DIR}/bmhs"
i=0
while read -r name address user password mac; do
go run "${BMOPATH}"/cmd/make-bm-worker/main.go \
-address "$address" \
-password "$password" \
-user "$user" \
-boot-mac "$mac" \
-boot-mode "${BOOT_MODE}" \
"$name"
"$name" | tee "${WORKING_DIR}/bmhs/node_${i}.yaml" >> "${WORKING_DIR}/bmhosts_crs.yaml"
i=$((i+1))
done
}

Expand All @@ -242,7 +245,7 @@ function make_bm_hosts() {
function apply_bm_hosts() {
NAMESPACE=$1
pushd "${BMOPATH}"
list_nodes | make_bm_hosts > "${WORKING_DIR}/bmhosts_crs.yaml"
list_nodes | make_bm_hosts
if [[ -n "$(list_nodes)" ]]; then
echo "bmhosts_crs.yaml is applying"
while ! kubectl apply -f "${WORKING_DIR}/bmhosts_crs.yaml" -n "$NAMESPACE" &>/dev/null; do
Expand Down

0 comments on commit e8786b8

Please sign in to comment.