You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 78be6df
Browse filesBrowse the repository at this point in the historyBrowse files
echo"Patched ${TARGETS[$i]}'s maxRunners to ${NEW_MAX[$i]} (${reason})"
96
96
fi
97
-
MAX[$i]=${NEW_MAX[$i]}
97
+
MAX[i]=${NEW_MAX[$i]}
98
98
done
99
99
write_status "$total""$reason""$headroom_mib"
100
100
}
@@ -103,7 +103,7 @@ apply_new_max() {
103
103
lower_to() {
104
104
local combined_target=$1 i combined=0
105
105
for((i =0; i <${#TARGETS[@]}; i++));do
106
-
NEW_MAX[$i]=${MAX[$i]}
106
+
NEW_MAX[i]=${MAX[$i]}
107
107
combined=$(( combined + NEW_MAX[i] ))
108
108
done
109
109
while [ "$combined"-gt"$combined_target" ];do
@@ -116,7 +116,7 @@ lower_to() {
116
116
fi
117
117
done
118
118
[ "$best"-ge 0 ] ||break# every target is already down at its own R; can't lower further without orphaning a running job
119
-
NEW_MAX[$best]=$(( NEW_MAX[best] -1))
119
+
NEW_MAX[best]=$(( NEW_MAX[best] -1))
120
120
combined=$(( combined -1))
121
121
done
122
122
}
@@ -131,8 +131,8 @@ raise_by_one() {
131
131
best=$i
132
132
fi
133
133
done
134
-
for((i =0; i <${#TARGETS[@]}; i++));do NEW_MAX[$i]=${MAX[$i]};done
135
-
NEW_MAX[$best]=$(( NEW_MAX[best] +1))
134
+
for((i =0; i <${#TARGETS[@]}; i++));do NEW_MAX[i]=${MAX[$i]};done
135
+
NEW_MAX[best]=$(( NEW_MAX[best] +1))
136
136
}
137
137
138
138
fail_safe() {
@@ -157,12 +157,12 @@ for i in "${!TARGETS[@]}"; do
157
157
r="$(kubectl get autoscalingrunnerset "$release" -n "$namespace" -o jsonpath='{.status.currentRunners}'2>/dev/null)" \
158
158
|| fail_safe "could not read ${target}'s status.currentRunners"
159
159
case"$r"in''|*[!0-9]*) fail_safe "${target}'s status.currentRunners was not a plain integer ('$r')" ;; esac
160
-
R[$i]=$r
160
+
R[i]=$r
161
161
162
162
max="$(kubectl get autoscalingrunnerset "$release" -n "$namespace" -o jsonpath='{.spec.maxRunners}'2>/dev/null)" \
163
163
|| fail_safe "could not read ${target}'s current spec.maxRunners"
164
164
case"$max"in''|*[!0-9]*) fail_safe "${target}'s spec.maxRunners was not a plain integer ('$max')" ;; esac
165
-
MAX[$i]=$max
165
+
MAX[i]=$max
166
166
167
167
# Wh: the pod's own hard memory limit, read from the live deployed spec, not re-parsed from values/*.yaml, so this always matches what is actually running even after a manual --set override.
168
168
wh_raw="$(kubectl get autoscalingrunnerset "$release" -n "$namespace" \
0 commit comments