mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-24 04:33:17 +00:00
Complete Discovery compilation and accept canonical PVE config keys
The first exact proof established all ten parent no-admission failures and registered-session controls, then stopped on a missing strings import. Complete that import and preserve ordinary hyphenated PVE dictionary keys while keeping duplicate/case-conflicting lock rejection. Contract-Neutral: Preserves the guest safety protocol and its lock, identity, budget and dispatch requirements; completes compilation and accepts canonical hyphenated config keys. Change-source: pulse-maintainer
This commit is contained in:
@@ -137,7 +137,7 @@ func guestExecConfigLock(config []byte) (string, bool) {
|
||||
return "", false
|
||||
}
|
||||
for _, c := range key {
|
||||
if !(c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c == '_') {
|
||||
if !(c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c == '_' || c == '-') {
|
||||
return "", false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ func TestGuestExecConfigLockDictionary(t *testing.T) {
|
||||
}{
|
||||
{"unlocked", "cores: 2\nname: home-assistant\n", "", true},
|
||||
{"unicode name", "name: café\nmemory: 8192\n", "", true},
|
||||
{"hyphenated PVE key", "name: vm\namd-sev: type=sev\n", "", true},
|
||||
{"backup", "name: vm\nlock: backup\n", "backup", true},
|
||||
{"other operation", "lock: migrate\n", "migrate", true},
|
||||
{"comment", "# lock: backup\nname: vm\n", "", true},
|
||||
|
||||
@@ -3,6 +3,7 @@ package servicediscovery
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user