update
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
action="${1:-}"
|
action="${1:-}"
|
||||||
FOLDER='/opt/idssys/ta-proxmenu'
|
FOLDER='/opt/idssys/ta-proxmenu'
|
||||||
VERS='2026.7.28-11'
|
VERS='2026.7.29-1'
|
||||||
|
|
||||||
noupdate=' '
|
noupdate=' '
|
||||||
|
|
||||||
|
|||||||
+11
-1
@@ -104,10 +104,12 @@ INSTALL_CLUSTER_UPDATES() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if [[ "$status" != "online" ]]; then
|
if [[ "$status" != "online" ]]; then
|
||||||
|
printf '\n'
|
||||||
echo -e "${idsCL[LightYellow]}Skipping ${node}: node status is ${status}.${idsCL[Default]}"
|
echo -e "${idsCL[LightYellow]}Skipping ${node}: node status is ${status}.${idsCL[Default]}"
|
||||||
cluster_failed=1
|
cluster_failed=1
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
printf '\n'
|
||||||
echo -e "${idsCL[LightCyan]}Updating remote node ${node}...${idsCL[Default]}"
|
echo -e "${idsCL[LightCyan]}Updating remote node ${node}...${idsCL[Default]}"
|
||||||
if TAPM_UPDATE_REMOTE_NODE "$node"; then
|
if TAPM_UPDATE_REMOTE_NODE "$node"; then
|
||||||
echo -e "${idsCL[Green]}Remote node ${node} is updated.${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Remote node ${node} is updated.${idsCL[Default]}"
|
||||||
@@ -117,8 +119,16 @@ INSTALL_CLUSTER_UPDATES() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
printf '\n'
|
||||||
echo -e "${idsCL[LightCyan]}Updating local node ${local_node}...${idsCL[Default]}"
|
echo -e "${idsCL[LightCyan]}Updating local node ${local_node}...${idsCL[Default]}"
|
||||||
INSTALL_LOCAL_UPDATES || cluster_failed=1
|
if INSTALL_LOCAL_UPDATES; then
|
||||||
|
echo -e "${idsCL[Green]}Local node ${local_node} is updated.${idsCL[Default]}"
|
||||||
|
else
|
||||||
|
echo -e "${idsCL[Red]}Local node ${local_node} failed to update.${idsCL[Default]}"
|
||||||
|
cluster_failed=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf '\n'
|
||||||
if (( cluster_failed == 0 )); then
|
if (( cluster_failed == 0 )); then
|
||||||
echo -e "${idsCL[Green]}TA-ProxMenu is updated on all ${#cluster_nodes[@]} cluster node(s).${idsCL[Default]}"
|
echo -e "${idsCL[Green]}TA-ProxMenu is updated on all ${#cluster_nodes[@]} cluster node(s).${idsCL[Default]}"
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ INSTALL_LOCAL_UPDATES() {
|
|||||||
|
|
||||||
if (( update_failed == 0 )); then
|
if (( update_failed == 0 )); then
|
||||||
source /opt/idssys/ta-proxmenu/defaults.inc
|
source /opt/idssys/ta-proxmenu/defaults.inc
|
||||||
echo -e "\n${idsCL[Green]}Update check complete. Installed version: ${VERS}${idsCL[Default]}"
|
echo -e "${idsCL[Green]}Update check complete. Installed version: ${VERS}${idsCL[Default]}"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -62,4 +62,18 @@ assert_equal $'remote:pve2\nlocal:pve1' \
|
|||||||
"$(cat "$update_log")" \
|
"$(cat "$update_log")" \
|
||||||
"online remotes and initiating node update once"
|
"online remotes and initiating node update once"
|
||||||
|
|
||||||
|
TAPM_CLUSTER_NODE_ROWS() {
|
||||||
|
printf 'pve1\tonline\npve2\tonline\n'
|
||||||
|
}
|
||||||
|
TAPM_UPDATE_REMOTE_NODE() {
|
||||||
|
printf 'remote update output\n'
|
||||||
|
}
|
||||||
|
INSTALL_LOCAL_UPDATES() {
|
||||||
|
printf 'local update output\n'
|
||||||
|
}
|
||||||
|
expected_output=$'Updating TA-ProxMenu across 2 cluster node(s)...\n\nUpdating remote node pve2...\nremote update output\nRemote node pve2 is updated.\n\nUpdating local node pve1...\nlocal update output\nLocal node pve1 is updated.\n\nTA-ProxMenu is updated on all 2 cluster node(s).'
|
||||||
|
assert_equal "$expected_output" \
|
||||||
|
"$(INSTALL_CLUSTER_UPDATES)" \
|
||||||
|
"each node update is grouped with blank lines only between node blocks"
|
||||||
|
|
||||||
finish_tests
|
finish_tests
|
||||||
|
|||||||
Reference in New Issue
Block a user