Avoid config migration on every startup (#16278)

This commit is contained in:
Klaus Post
2022-12-19 20:10:14 +01:00
committed by GitHub
parent ed37b7a9d5
commit b4f71362e9
8 changed files with 59 additions and 30 deletions

View File

@@ -2533,6 +2533,21 @@ func checkConfigVersion(objAPI ObjectLayer, configFile string, version string) (
}
}
if version == "kvs" {
// Check api config values are present.
var vcfg struct {
API struct {
E []struct {
Key string `json:"key"`
Value string `json:"value"`
} `json:"_"`
} `json:"api"`
}
if err = json.Unmarshal(data, &vcfg); err != nil {
return false, nil, nil
}
return len(vcfg.API.E) > 0, data, nil
}
var versionConfig struct {
Version string `json:"version"`
}