Skip to content

Commit

Permalink
fix: keep trying
Browse files Browse the repository at this point in the history
  • Loading branch information
bkenez committed Feb 4, 2025
1 parent b3c8611 commit ce7a595
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions aws/dual-region/scripts/generate_zeebe_helm_values.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,26 @@ generate_initial_contact() {
local port_number=26502
local result=""

count=$((count)) # Force integer conversion

# Trim spaces and validate
count=$(echo "$count" | tr -d '[:space:]')

if ! [[ "$count" =~ ^[0-9]+$ ]]; then
echo "Error: count must be a valid integer" >&2
exit 1
fi

local half_count=$((count / 2)) # Perform division safely
count=$((count)) # Force integer conversion
local half_count=$((count / 2))

echo "DEBUG: count='$count'"
echo "DEBUG: half_count='$half_count'"

for ((i=0; i<half_count; i++)); do
# Alternative loop to avoid "Bad for loop variable" issues
i=0
while [[ $i -lt $half_count ]]; do
result+="${release}-zeebe-${i}.${release}-zeebe.${ns_0}.svc.cluster.local:${port_number},"
result+="${release}-zeebe-${i}.${release}-zeebe.${ns_1}.svc.cluster.local:${port_number},"
((i++))
done
echo "${result%,}" # Remove the trailing comma
}
Expand Down

0 comments on commit ce7a595

Please sign in to comment.