Skip to content

Commit

Permalink
Fix no name_prefix issue.
Browse files Browse the repository at this point in the history
Signed-off-by: Zheng Xiao Mei <[email protected]>
  • Loading branch information
zhengxiaomei123 authored and bjhuangr committed Jun 19, 2024
1 parent cf679cb commit 924b23c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@
}
})

name_prefix = sys.argv[4]
if len(sys.argv) > 4:
name_prefix = sys.argv[4]
else:
name_prefix = ''

if name_prefix:
name_prefix_byte = name_prefix.encode()
bootstrap_hostname = base64.standard_b64encode(name_prefix_byte).decode().strip()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@

infra_id=$1
master_end=$(($2 - 1))
name_prefix=$3

for index in $( seq 0 $master_end); do
if [ -n "$name_prefix" ]; then
MASTER_HOSTNAME="$name_prefix-$index\n"
IGNITION_NAME="$name_prefix-$index"
if [ -n "$3" ]; then
MASTER_HOSTNAME="$3-$index\n"
IGNITION_NAME="$3-$index"
else
MASTER_HOSTNAME="$infra_id-master-$index\n"
IGNITION_NAME="$infra_id-master-$index"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
# =================================================================
infra_id=$1
worker_end=$(($2 - 1))
name_prefix=$3

for index in $( seq 0 $worker_end); do
if [ -n "$name_prefix" ]; then
WORKER_HOSTNAME="$name_prefix-$index\n"
IGNITION_NAME="$name_prefix-$index"
if [ -n "$3" ]; then
WORKER_HOSTNAME="$3-$index\n"
IGNITION_NAME="$3-$index"
else
WORKER_HOSTNAME="$infra_id-worker-$index\n"
IGNITION_NAME="$infra_id-worker-$index"
Expand Down

0 comments on commit 924b23c

Please sign in to comment.