Switch qm monitor I/O from pipes to PTY using creack/pty

qm monitor requires a TTY to emit its prompt; the pipe-based approach
missed prompt detection on some hosts. Replace with pty.Start, refactor
readUntilMarker to scan byte-by-byte with deadline goroutine, and add
parseQMResponse to strip command echo and \r artifacts. Add unit tests
for the new reader and parser functions.
This commit is contained in:
illustris
2026-03-12 09:52:26 +00:00
parent 00404095b9
commit e9b60a3af6
5 changed files with 175 additions and 63 deletions

View File

@@ -8,7 +8,7 @@ buildGoModule rec {
pname = "pve-local-exporter";
version = "0.1.0";
src = ./src;
vendorHash = "sha256-f0f8tYmoI6DtuB/K4++gu9b2na/d0ECTaF2zvDijW58=";
vendorHash = "sha256-MLB7y7shnOhxW8K2R6+d9E63wGEhlErnv+1MYOJO3Hw=";
ldflags = [
"-X=main.version=${version}"
];