This commit is contained in:
2026-07-25 22:05:50 -05:00
parent 854309c3a1
commit 55babe1ba2
3 changed files with 64 additions and 1 deletions
+41
View File
@@ -561,6 +561,41 @@ json.dump(data, sys.stdout, separators=(",", ":"))
'
}
TAPM_PULSE_CREATE_PVE_AUTO_REGISTER_TOKEN() {
local token_name="$1"
local output_variable="$2"
local status_variable="$3"
local command_output=''
local command_status=0
if command_output="$(
pveum user token add pulse-monitor@pve "$token_name" \
--privsep 1 --output-format json 2>&1
)"; then
command_status=0
else
command_status=$?
fi
# Older pveum versions reject --output-format and require table parsing.
if (( command_status != 0 )) &&
grep -Eqi \
'unknown option|unknown command|no such option|unable to parse option|output-format' \
<<<"$command_output"; then
if command_output="$(
pveum user token add pulse-monitor@pve "$token_name" \
--privsep 1 2>&1
)"; then
command_status=0
else
command_status=$?
fi
fi
printf -v "$output_variable" '%s' "$command_output"
printf -v "$status_variable" '%s' "$command_status"
}
TAPM_PULSE_REGISTER_CLUSTER() {
local ctid="$1"
local container_ip="$2"
@@ -582,6 +617,12 @@ TAPM_PULSE_REGISTER_CLUSTER() {
# shellcheck disable=SC1090
source "$installer"
IN_CONTAINER=false
# Pulse v6.1.1's helper shadows the caller's token_output and
# token_status variables, discarding a successful pveum result.
# Override only that helper so auto_register_pve_node receives them.
create_pve_auto_register_token() {
TAPM_PULSE_CREATE_PVE_AUTO_REGISTER_TOKEN "$@"
}
# Pulse v6.1.1's installer omits backup_perms from its expected
# artifact URLs even when it requests backupPerms=true. That causes it
# to reject Pulse's otherwise valid response as "missing setup token."