Leave a unit alone when another declared service still holds it (hq issue 190) #26

Merged
mesh-admin merged 2 commits from test/190-into-json-member-handover into main 2026-10-05 20:31:33 +00:00
Showing only changes of commit f0f5873202 - Show all commits
+3 -3
View File
@@ -2852,9 +2852,6 @@ func userUnitFiles(account, unit string) []string {
return paths
}
// unitKey names a unit by the manager it is in and its name (novox/hq ADR 0177): the machine's
// manager, or one account's. A system unit is the same key whether its record says "system" or
// nothing, as every record before the scope existed does.
// unitsHeld is every unit a declared service gives a state, by unitKey, naming the service.
func unitsHeld(resources []declaration.Resource) map[string]string {
held := map[string]string{}
@@ -2866,6 +2863,9 @@ func unitsHeld(resources []declaration.Resource) map[string]string {
return held
}
// unitKey names a unit by the manager it is in and its name (novox/hq ADR 0177): the machine's
// manager, or one account's. A system unit is the same key whether its record says "system" or
// nothing, as every record before the scope existed does.
func unitKey(scope, user, unit string) string {
if scope == declaration.ScopeUser {
return "user:" + user + "/" + unit