mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 11:30:15 +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:
parent
28cd487889
commit
4419d8be87
1 changed files with 3 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue