mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
fix: Container update command incorrectly removes Docker host and revokes token
When a container update command completed successfully, the server was incorrectly returning shouldRemove=true, which caused the Docker host to be removed and its API token revoked. This caused 401 Unauthorized errors for subsequent agent reports. The fix ensures shouldRemove is only true for "stop" commands, not for "update_container" or "check_updates" commands. Related to #1020
This commit is contained in:
@@ -362,7 +362,11 @@ func (m *Monitor) acknowledgeDockerCommand(commandID, hostID, status, message st
|
||||
case DockerCommandStatusCompleted:
|
||||
cmd.markAcknowledged(message)
|
||||
cmd.markCompleted(message)
|
||||
shouldRemove = true
|
||||
// Only remove the Docker host if this was a "stop" command.
|
||||
// Other commands (update_container, check_updates) should not remove the host.
|
||||
if cmd.status.Type == DockerCommandTypeStop {
|
||||
shouldRemove = true
|
||||
}
|
||||
case DockerCommandStatusFailed:
|
||||
cmd.markFailed(message)
|
||||
m.state.SetDockerHostPendingUninstall(resolvedHostID, false)
|
||||
|
||||
Reference in New Issue
Block a user