From 9580c8c75d9821bf762a349b6bedb5e051e55e33 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Fri, 12 Jun 2026 17:51:52 +0200 Subject: [PATCH] fix(P3): record enrolled intent on the idempotent guest-attach path too --- internal/localapi/disks.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/localapi/disks.go b/internal/localapi/disks.go index 94372e0..0275cfb 100644 --- a/internal/localapi/disks.go +++ b/internal/localapi/disks.go @@ -260,9 +260,12 @@ func (s *Server) handleDiskGuestAttach(w http.ResponseWriter, r *http.Request, v return } mounts := cfg.MountPoints() - // Idempotency: already bound at `where`? (a bind's mp= equals the guest path). + // Idempotency: already bound at `where`? (a bind's mp= equals the guest path). Still (re)record the + // ENROLLED intent — a drive bound at a prior boot must be known to self-heal even if never + // re-attached this process lifetime. for key, spec := range mounts { if _, mp, _ := parseMount(spec); mp == where { + s.recordIntent(r.Context(), where, "enrolled") s.logger.Info("local-api: guest-attach idempotent (already bound)", "vmid", vmid, "where", where, "slot", key) writeOK(w, map[string]any{"vmid": vmid, "attached": where, "slot": key, "already": true}) return