Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Write bmhs in separated files #1353

Merged
Merged
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
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