From 9bc050371b433f371e7ee1806fb412062b892e7f Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Wed, 6 Aug 2025 17:14:34 +0000 Subject: [PATCH] fix: Docker persistence actually fixed this time The ConfigHandlers were calling config.SaveConfig() which uses globalPersistence initialized at startup with potentially wrong path. Now handlers use their own persistence instance directly which is initialized with the correct DataPath. This was causing Docker configurations to still save to /etc/pulse even though we thought we fixed it in v4.0.6. Fixes #253 (for real this time) --- DOCKER_PUSH_INSTRUCTIONS.md | 49 +++++++++++++++++++++++++++++++++ VERSION | 2 +- internal/api/config_handlers.go | 12 ++++---- internal/updates/version.go | 2 +- 4 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 DOCKER_PUSH_INSTRUCTIONS.md diff --git a/DOCKER_PUSH_INSTRUCTIONS.md b/DOCKER_PUSH_INSTRUCTIONS.md new file mode 100644 index 000000000..52e85092f --- /dev/null +++ b/DOCKER_PUSH_INSTRUCTIONS.md @@ -0,0 +1,49 @@ +# Docker Push Instructions for v4.0.6 + +The Docker image has been built locally but needs to be pushed from a machine with Docker Hub credentials. + +## Option 1: Push from this machine +```bash +# Login to Docker Hub +sudo docker login -u rcourtman + +# Push all tags +sudo docker push rcourtman/pulse:v4.0.6 +sudo docker push rcourtman/pulse:4.0.6 +sudo docker push rcourtman/pulse:4.0 +sudo docker push rcourtman/pulse:4 +sudo docker push rcourtman/pulse:latest +``` + +## Option 2: Build and push from docker-builder container (192.168.0.174) +```bash +ssh root@192.168.0.174 +cd /root/Pulse +git pull +docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 \ + -t rcourtman/pulse:v4.0.6 \ + -t rcourtman/pulse:4.0.6 \ + -t rcourtman/pulse:4.0 \ + -t rcourtman/pulse:4 \ + -t rcourtman/pulse:latest \ + --push . +``` + +## Option 3: Build multi-arch locally with buildx +```bash +# Create buildx builder if not exists +docker buildx create --name multiarch --use + +# Build and push +docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 \ + -t rcourtman/pulse:v4.0.6 \ + -t rcourtman/pulse:4.0.6 \ + -t rcourtman/pulse:4.0 \ + -t rcourtman/pulse:4 \ + -t rcourtman/pulse:latest \ + --push . +``` + +The v4.0.6 release fixes: +- Docker persistence issue (#253) +- Windows VM memory reporting with balloon drivers (#258) \ No newline at end of file diff --git a/VERSION b/VERSION index d13e837c8..43beb4001 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.6 +4.0.7 diff --git a/internal/api/config_handlers.go b/internal/api/config_handlers.go index 397bd2441..afc2fcffa 100644 --- a/internal/api/config_handlers.go +++ b/internal/api/config_handlers.go @@ -344,8 +344,8 @@ func (h *ConfigHandlers) HandleAddNode(w http.ResponseWriter, r *http.Request) { h.config.PBSInstances = append(h.config.PBSInstances, pbs) } - // Save configuration to disk - if err := config.SaveConfig(h.config); err != nil { + // Save configuration to disk using our persistence instance + if err := h.persistence.SaveNodesConfig(h.config.PVEInstances, h.config.PBSInstances); err != nil { log.Error().Err(err).Msg("Failed to save nodes configuration") http.Error(w, "Failed to save configuration", http.StatusInternalServerError) return @@ -663,8 +663,8 @@ func (h *ConfigHandlers) HandleUpdateNode(w http.ResponseWriter, r *http.Request return } - // Save configuration to disk - if err := config.SaveConfig(h.config); err != nil { + // Save configuration to disk using our persistence instance + if err := h.persistence.SaveNodesConfig(h.config.PVEInstances, h.config.PBSInstances); err != nil { log.Error().Err(err).Msg("Failed to save nodes configuration") http.Error(w, "Failed to save configuration", http.StatusInternalServerError) return @@ -715,8 +715,8 @@ func (h *ConfigHandlers) HandleDeleteNode(w http.ResponseWriter, r *http.Request return } - // Save configuration to disk - if err := config.SaveConfig(h.config); err != nil { + // Save configuration to disk using our persistence instance + if err := h.persistence.SaveNodesConfig(h.config.PVEInstances, h.config.PBSInstances); err != nil { log.Error().Err(err).Msg("Failed to save nodes configuration") http.Error(w, "Failed to save configuration", http.StatusInternalServerError) return diff --git a/internal/updates/version.go b/internal/updates/version.go index 6551b16ae..837fbd18c 100644 --- a/internal/updates/version.go +++ b/internal/updates/version.go @@ -143,7 +143,7 @@ func GetCurrentVersion() (*VersionInfo, error) { // Final fallback return &VersionInfo{ - Version: "4.0.6", + Version: "4.0.7", Build: "release", Runtime: "go", IsDevelopment: false,