Let the GPU transform actually run when deploying to a partner

The detection pattern starts with --, so grep parsed it as an option and exited 2; the negation
made the early return always true and every XML was deployed untransformed, keeping the owner's
NVIDIA device UUID on hosts that have no such card.
This commit is contained in:
Gmer4Lfe
2026-08-23 16:38:58 -04:00
parent a392108562
commit dc8823724d
+6 -1
View File
@@ -174,7 +174,12 @@ transform_xml_for_gpu() {
local src_xml="$1" gpu_type="$2"
# Detect GPU-aware XMLs — new style (--gpus "device=) or old style (--runtime=nvidia)
if ! grep -qE '--gpus[[:space:]]+"device=|--runtime=nvidia|NVIDIA_VISIBLE_DEVICES' "$src_xml" 2>/dev/null; then
# -- before the pattern is load-bearing: it begins with "--", so without it grep parses the
# pattern as an OPTION, exits 2, and the ! makes this branch always true — the function then
# returned the XML untransformed every single time, for every GPU type, with 2>/dev/null
# swallowing "invalid option". Every container onboarded to a mirror kept the owner NVIDIA
# device UUID and could not start on Intel or AMD hardware. Found 2026-08-23.
if ! grep -qE -- '--gpus[[:space:]]+"device=|--runtime=nvidia|NVIDIA_VISIBLE_DEVICES' "$src_xml" 2>/dev/null; then
echo "$src_xml"
return 0
fi