mirror of
https://github.com/minio/minio.git
synced 2025-12-03 06:22:32 -05:00
server: save and compare multiple disks are used (#1474)
When server is run with multiple disks which uses xl interface where order and count of disks are important, this patch saves such disks configuration and compares in next run if there is a mismatch. Fixes #1458
This commit is contained in:
23
config.go
23
config.go
@@ -86,3 +86,26 @@ func getConfigFile() (string, error) {
|
||||
}
|
||||
return filepath.Join(configPath, globalMinioConfigFile), nil
|
||||
}
|
||||
|
||||
// isFormatConfigFileExists - returns true if format config file exists.
|
||||
func isFormatConfigFileExists() bool {
|
||||
st, err := os.Stat(mustGetFormatConfigFile())
|
||||
return (err == nil && st.Mode().IsRegular())
|
||||
}
|
||||
|
||||
// mustGetFormatConfigFile must get format config file.
|
||||
func mustGetFormatConfigFile() string {
|
||||
configFile, err := getFormatConfigFile()
|
||||
fatalIf(err, "Unable to get format config file.", nil)
|
||||
|
||||
return configFile
|
||||
}
|
||||
|
||||
// getFormatConfigFile get format config file.
|
||||
func getFormatConfigFile() (string, error) {
|
||||
configPath, err := getConfigPath()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return filepath.Join(configPath, globalMinioFormatConfigFile), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user