Skip to content

Commit d271f79

Browse files
committed
Fix temperature monitoring for standalone Proxmox nodes and add multi-arch sensor proxy builds
Related to #571 This addresses multiple temperature monitoring issues: 1. Fix single-node Proxmox installation failure: Add '|| true' to pvecm status calls to prevent script exit on standalone (non-clustered) nodes with 'set -euo pipefail'. The script now properly falls through to standalone node configuration when cluster detection fails. 2. Build pulse-sensor-proxy for all Linux architectures (amd64, arm64, armv7) in Dockerfile to ensure binaries are available for download on all supported platforms. This resolves the missing binary issue from v4.23.0. Note: AMD Tctl sensor support was already implemented in a previous commit.
1 parent a4f9f6c commit d271f79

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

Dockerfile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,22 @@ RUN --mount=type=cache,id=pulse-go-mod,target=/go/pkg/mod \
105105
-trimpath \
106106
-o pulse-host-agent-windows-amd64.exe ./cmd/pulse-host-agent
107107

108-
# Build pulse-sensor-proxy
108+
# Build pulse-sensor-proxy for all Linux architectures (for download endpoint)
109109
RUN --mount=type=cache,id=pulse-go-mod,target=/go/pkg/mod \
110110
--mount=type=cache,id=pulse-go-build,target=/root/.cache/go-build \
111-
CGO_ENABLED=0 GOOS=linux go build \
111+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
112+
-ldflags="-s -w" \
113+
-trimpath \
114+
-o pulse-sensor-proxy-linux-amd64 ./cmd/pulse-sensor-proxy && \
115+
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build \
116+
-ldflags="-s -w" \
117+
-trimpath \
118+
-o pulse-sensor-proxy-linux-arm64 ./cmd/pulse-sensor-proxy && \
119+
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build \
112120
-ldflags="-s -w" \
113121
-trimpath \
114-
-o pulse-sensor-proxy ./cmd/pulse-sensor-proxy
122+
-o pulse-sensor-proxy-linux-armv7 ./cmd/pulse-sensor-proxy && \
123+
cp pulse-sensor-proxy-linux-amd64 pulse-sensor-proxy
115124

116125
# Runtime image for the Docker agent (offered via --target agent_runtime)
117126
FROM alpine:3.20 AS agent_runtime
@@ -188,7 +197,10 @@ COPY --from=backend-builder /app/pulse-host-agent-windows-amd64.exe /opt/pulse/b
188197
# Create symlink for Windows without .exe extension
189198
RUN ln -s pulse-host-agent-windows-amd64.exe /opt/pulse/bin/pulse-host-agent-windows-amd64
190199

191-
# Copy pulse-sensor-proxy binary for download endpoint
200+
# Copy multi-arch pulse-sensor-proxy binaries for download endpoint
201+
COPY --from=backend-builder /app/pulse-sensor-proxy-linux-amd64 /opt/pulse/bin/
202+
COPY --from=backend-builder /app/pulse-sensor-proxy-linux-arm64 /opt/pulse/bin/
203+
COPY --from=backend-builder /app/pulse-sensor-proxy-linux-armv7 /opt/pulse/bin/
192204
COPY --from=backend-builder /app/pulse-sensor-proxy /opt/pulse/bin/pulse-sensor-proxy
193205

194206
# Create config directory

scripts/install-sensor-proxy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ cleanup_cluster_authorized_keys_manual() {
101101
if command -v pvecm >/dev/null 2>&1; then
102102
while IFS= read -r node_ip; do
103103
[[ -n "$node_ip" ]] && nodes+=("$node_ip")
104-
done < <(pvecm status 2>/dev/null | awk '/0x[0-9a-f]+.*[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/ {print $3}')
104+
done < <(pvecm status 2>/dev/null | awk '/0x[0-9a-f]+.*[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/ {print $3}' || true)
105105
fi
106106

107107
if [[ ${#nodes[@]} -eq 0 ]]; then
@@ -841,7 +841,7 @@ if [[ -z "$HOST" ]]; then
841841
842842
# Discover cluster nodes
843843
if command -v pvecm >/dev/null 2>&1; then
844-
CLUSTER_NODES=$(pvecm status 2>/dev/null | awk '/0x[0-9a-f]+.*[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/ {print $3}')
844+
CLUSTER_NODES=$(pvecm status 2>/dev/null | awk '/0x[0-9a-f]+.*[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/ {print $3}' || true)
845845
846846
if [[ -n "$CLUSTER_NODES" ]]; then
847847
for node_ip in $CLUSTER_NODES; do
@@ -1016,7 +1016,7 @@ print_info "Proxy public key: ${PROXY_PUBLIC_KEY:0:50}..."
10161016
# Discover cluster nodes
10171017
if command -v pvecm >/dev/null 2>&1; then
10181018
# Extract node IPs from pvecm status
1019-
CLUSTER_NODES=$(pvecm status 2>/dev/null | awk '/0x[0-9a-f]+.*[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/ {print $3}')
1019+
CLUSTER_NODES=$(pvecm status 2>/dev/null | awk '/0x[0-9a-f]+.*[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/ {print $3}' || true)
10201020

10211021
if [[ -n "$CLUSTER_NODES" ]]; then
10221022
print_info "Discovered cluster nodes: $(echo $CLUSTER_NODES | tr '\n' ' ')"

scripts/pulse-sensor-cleanup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if [[ -z "$HOST" ]]; then
5050

5151
# Discover cluster nodes
5252
if command -v pvecm >/dev/null 2>&1; then
53-
CLUSTER_NODES=$(pvecm status 2>/dev/null | awk '/0x[0-9a-f]+.*[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/ {print $3}')
53+
CLUSTER_NODES=$(pvecm status 2>/dev/null | awk '/0x[0-9a-f]+.*[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/ {print $3}' || true)
5454

5555
if [[ -n "$CLUSTER_NODES" ]]; then
5656
for node_ip in $CLUSTER_NODES; do

0 commit comments

Comments
 (0)