mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 14:00:29 +00:00
fix(sensor-proxy): sanitize duplicate blocks before migration
The migrate-to-file command now calls sanitizeDuplicateAllowedNodesBlocks before parsing the config, allowing it to handle corrupted configs with duplicate allowed_nodes blocks. This ensures migration works even on hosts that were affected by the original corruption issue.
This commit is contained in:
@@ -407,6 +407,9 @@ func migrateInlineToFile(configPath, allowedNodesPath string) error {
|
||||
return fmt.Errorf("failed to read config: %w", err)
|
||||
}
|
||||
|
||||
// Sanitize duplicate blocks before parsing
|
||||
_, configData = sanitizeDuplicateAllowedNodesBlocks(configPath, configData)
|
||||
|
||||
// Parse config to extract inline nodes
|
||||
var config map[string]interface{}
|
||||
if err := yaml.Unmarshal(configData, &config); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user