config -- Avoid deleting existing dns section if someone removes schema_version from yaml file.
This commit is contained in:
@@ -126,8 +126,10 @@ func upgradeSchema1to2(diskConfig *map[string]interface{}) error {
|
||||
}
|
||||
}
|
||||
|
||||
(*diskConfig)["dns"] = (*diskConfig)["coredns"]
|
||||
delete((*diskConfig), "coredns")
|
||||
if _, ok := (*diskConfig)["dns"]; !ok {
|
||||
(*diskConfig)["dns"] = (*diskConfig)["coredns"]
|
||||
delete((*diskConfig), "coredns")
|
||||
}
|
||||
(*diskConfig)["schema_version"] = 2
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user