Skip to content

Commit

Permalink
staunch some type bleeding
Browse files Browse the repository at this point in the history
  • Loading branch information
vilmibm committed Apr 17, 2020
1 parent a0b7f37 commit e823ad0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions context/config_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ func isLegacy(root *yaml.Node) bool {
}

func migrateConfig(fn string, root *yaml.Node) error {
// TODO i'm sorry
newConfigData := map[string]map[string]map[string]string{}
newConfigData["hosts"] = map[string]map[string]string{}
type ConfigEntry map[string]string
type ConfigHash map[string]ConfigEntry

newConfigData := map[string]ConfigHash{}
newConfigData["hosts"] = ConfigHash{}

topLevelKeys := root.Content[0].Content

Expand All @@ -102,7 +104,7 @@ func migrateConfig(fn string, root *yaml.Node) error {
break
}
hostname := x.Value
newConfigData["hosts"][hostname] = map[string]string{}
newConfigData["hosts"][hostname] = ConfigEntry{}

authKeys := topLevelKeys[i+1].Content[0].Content

Expand Down

0 comments on commit e823ad0

Please sign in to comment.