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:
rcourtman 2025-11-19 10:38:04 +00:00
parent 28cd487889
commit 4419d8be87

View file

@ -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 {