20889: Fixes a bug when database & controller roles are on a single node.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Fri, 25 Aug 2023 13:30:11 +0000 (10:30 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Fri, 25 Aug 2023 13:30:11 +0000 (10:30 -0300)
The database role gets handled first, so the controller node gets removed
from the list and then when checking if multiple nodes were available, the
code path for a single controller didn't checked if the node was already
removed from the node list.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

tools/salt-install/installer.sh

index fe04047431b42091d290ee05f0f49262275f1765..a1e3841a3dd93f29a97e23c2ecf2c74fc4322f6c 100755 (executable)
@@ -338,10 +338,12 @@ case "$subcmd" in
                    fi
                done
            else
-               # Only one controller
+               # Only one controller, check if it wasn't already taken care of.
                NODE=${ROLE2NODES['controller']}
-               deploynode $NODE "${NODES[$NODE]}" $BRANCH
-               unset NODES[$NODE]
+               if [[ ! -z "${NODES[$NODE]:-}" ]]; then
+                       deploynode $NODE "${NODES[$NODE]}" $BRANCH
+                       unset NODES[$NODE]
+               fi
            fi
 
            if [[ -n "$BALANCER" ]] ; then